uploading files to an Internet site

Posted on 2001-08-22
Last Modified: 2011-09-20

In reference to a mail I read recently I discovered that using ABCUpload4 which can be downloaded from enabled one to upload files from a client machine to a web server by installing the program onto the web server machine.  However this works fine on our intranet, but our internet site is held with a hosting company in which we cannt install/register files.
To cut a long story short does anyone know where I could find a way to upload files to our Internet??

Any ideas welcome

Question by:louise_8

Expert Comment

ID: 6412587
LVL 33

Accepted Solution

hongjun earned 75 total points
ID: 6412591
>>we cannt install/register files
Then you got to use Pure AspUpload.
See the below 2 links

LVL 33

Expert Comment

ID: 6412598
You might also wish to use Microsoft's Posting Acceptor. See below for full documentation.

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.


Expert Comment

ID: 6412599

Try this:

Wee Siong

Expert Comment

ID: 6412726
i think aspupload is the best option.

It basically depends on the component installed by your hosting co in their server. You have to check up with them first and then only you can proceed.

It is not certain that they might be havig ASPUpload as recommended by one expert here

Expert Comment

ID: 6412727
It basically depends on the component installed by your hosting co in their server. You have to check up with them first and then only you can proceed.

It is not certain that they might be havig ASPUpload as recommended by one expert here

Expert Comment

ID: 6413186
You could use PureASP, but here is a page that I use.  THere are a few variables you will need to change, namely the directory you want to store the images, I use "download". Also where it says ToFolder (I added XXXX so you could find it)

This took alot of coding, so I hope you like it.

Function gen_key(digits)

     dim char_array(50)
     char_array(0) = "0"
     char_array(1) = "1"
     char_array(2) = "2"
     char_array(3) = "3"
     char_array(4) = "4"
     char_array(5) = "5"
     char_array(6) = "6"
     char_array(7) = "7"
     char_array(8) = "8"
     char_array(9) = "9"
     char_array(10) = "A"
     char_array(11) = "B"
     char_array(12) = "C"
     char_array(13) = "D"
     char_array(14) = "E"
     char_array(15) = "F"
     char_array(16) = "G"
     char_array(17) = "H"
     char_array(18) = "I"
     char_array(19) = "J"
     char_array(20) = "K"
     char_array(21) = "L"
     char_array(22) = "M"
     char_array(23) = "N"
     char_array(24) = "O"
     char_array(25) = "P"
     char_array(26) = "Q"
     char_array(27) = "R"
     char_array(28) = "S"
     char_array(29) = "T"
     char_array(30) = "U"
     char_array(31) = "V"
     char_array(32) = "W"
     char_array(33) = "X"
     char_array(34) = "Y"
     char_array(35) = "Z"

'Next we want to start the randomize statement.


'Next we loop through all of the digits to get the output.
       Dim num, output
     do while len(output) < digits
          num = char_array(Int((35 - 0 + 1) * Rnd + 0))
          output = output + num

'Now we set our output and end the function.

     gen_key = output
End Function

Response.Buffer = true
Function BuildUpload(RequestBin)
     'Get the boundary
     PosBeg = 1
     PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
     boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
     boundaryPos = InstrB(1,RequestBin,boundary)
     'Get all data inside the boundaries
     Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
          'Members variable of objects are put in a dictionary object
          Dim UploadControl
          Set UploadControl = CreateObject("Scripting.Dictionary")
          'Get an object name
          Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition"))
          Pos = InstrB(Pos,RequestBin,getByteString("name="))
          PosBeg = Pos+6
          PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
          Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
          PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename="))
          PosBound = InstrB(PosEnd,RequestBin,boundary)
          'Test if object is of file type
          If PosFile<>0 AND (PosFile<PosBound) Then
               'Get Filename, content-type and content of file
               PosBeg = PosFile + 10
               PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
               FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
               'Add filename to dictionary object
               UploadControl.Add "FileName", FileName
               Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
               PosBeg = Pos+14
               PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
               'Add content-type to dictionary object
               ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
               UploadControl.Add "ContentType",ContentType
               'Get content of object
               PosBeg = PosEnd+4
               PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
               Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
               'Get content of object
               Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
               PosBeg = Pos+4
               PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
               Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
          End If
          UploadControl.Add "Value" , Value    
          UploadRequest.Add name, UploadControl    
End Function

Function getByteString(StringStr)
     For i = 1 to Len(StringStr)
          char = Mid(StringStr,i,1)
          getByteString = getByteString & chrB(AscB(char))
End Function

Function getString(StringBin)
     getString =""
     For intCount = 1 to LenB(StringBin)
          getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
End Function

If request("Action")="1" then
dim FileName1
'Use this to give it a random name.
FileName1 = gen_key(10)

     byteCount = Request.TotalBytes
     RequestBin = Request.BinaryRead(byteCount)
     Set UploadRequest = CreateObject("Scripting.Dictionary")

     If UploadRequest.Item("blob").Item("Value") <> "" Then

          contentType = UploadRequest.Item("blob").Item("ContentType")
          filepathname = UploadRequest.Item("blob").Item("FileName")
          filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
          FolderName = UploadRequest.Item("where").Item("Value")
          Path = Mid(Request.ServerVariables("PATH_TRANSLATED"), 1, Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(Request.ServerVariables("PATH_INFO"))) & "\"
'Replace this XXXX with your code.
          ToFolder = Path & "\XXXX\" & FolderName
          value = UploadRequest.Item("blob").Item("Value")
          filename = ToFolder & "\" & FileName1 & "_" & replace(filename," ","_")
          Set MyFileObject = Server.CreateObject("Scripting.FileSystemObject")
          Set objFile = MyFileObject.CreateTextFile(filename)
          For i = 1 to LenB(value)
               objFile.Write chr(AscB(MidB(value,i,1)))
          Set objFile = Nothing
          Set MyFileObject = Nothing
    End If
     Set UploadRequest = Nothing
Session("upload") = FileName1 & "_" & Replace(Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))," ","_")
'response.write Session("photoname")
<!-- Replace your's here
<link href=css/menus.css rel=stylesheet type=text/css>
<body bgcolor="#F0F2F0">
            RW "<p>" & _
            "<font color=""#2a5b49"">" & _
            "<font size=3>Success</font><br>" & _
            "<br><hr color=#2a5b49<br>"
      <a href="javascript:window.close();" language="javascript"><font face=verdana size=1>Close Window</a>
      RW "File: " & Session("Upload") & " has been successfully uploaded."

<link href=css/menus.css rel=stylesheet type=text/css>
<script language="VBScript">
sub Upload_onclick
      document.all("Upload").style.display = "none"
      document.all("wait").style.display = "inline"
end sub
<body bgcolor="#F0F2F0">
<form METHOD="POST" ENCTYPE="multipart/form-data" action="Upload.asp?Action=1&next=1" name="form1" id="form1" ACCEPT="image/jpg">
<table cellspacing="0" cellpadding="3" width="100%" border="0">
               <b><font >Select an image to upload: </font></b>
               <input size=35 class="button" TYPE="file" NAME="blob" value>
               <input TYPE="HIDDEN" NAME="where" value="download">

               <input TYPE="submit"  id="Upload" NAME="Upload" Value="Click to Upload" style="Display:inline;">
               <font id=wait name=wait style="Display:none;"><b>Please Wait</b></font>
                              <font size=3 color=red><b>IMPORTANT:</b></font><font face=verdana style="FONT-SIZE:8pt;FONT-WEIGHT:bold;"> (Please only .jpg or .gif files)</font><BR>

LVL 19

Expert Comment

ID: 6413674
If you can't change anything on the server, and they don't have anything and won't install anything to allow for anonymous uploads, I can't see how you can allow uploads.

This isn't within your control, not really. If upload via a web form is important, then you might want to look for another hosting company.

However, if you're just talking about YOU uploading new/changed files to your internet site, any FTP client will work just fine. You'll just need info from your hosting company on how to configure it (host info, username/password, etc.)

Author Comment

ID: 6414038
Thought I accepted this earlier.

anyway, I just altered the code a little to get the path where the host company stored our files -(Server.mappath)


Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question