Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

uploading files to an Internet site

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

1 Solution
>>we cannt install/register files
Then you got to use Pure AspUpload.
See the below 2 links

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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions


Try this:

Wee Siong
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
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
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>

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.)
louise_8Author Commented:
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)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now