Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I'm using vbscript in asp classic. I also used the FreeASPUpload class.. I want to upload file not in local, but to a server using its IP address as path..

Here is the code working if i will upload in local..
Dim uploadsDirVar
uploadsDirVar = Server.MapPath("../temp/")

Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)

But i want to upload it in a path with an ip address.. Below are the codes I tried but its resulting in HTTP 500 Internal Server Error..
Dim uploadsDirVar
uploadsDirVar = "\\123.45.6.789\DocFolder\"

Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)

I already mapped the folder \123.45.6.789\DocFolder\ in my local because of the login. I also tried codes with credentials but still same error.. See below:
Dim ServerShare 
Dim UserName 
Dim Password 
Dim NetworkObject 
Dim FSO

ServerShare = "\\123.45.6.789\DocFolder\"
UserName = "domain\username"
Password = "password"

Set NetworkObject = CreateObject("WScript.Network")
Set FSO = CreateObject("Scripting.FileSystemObject")

NetworkObject.MapNetworkDrive "", ServerShare, False, UserName, Password

Dim uploadsDirVar
uploadsDirVar = "\\123.45.6.789\DocFolder\"

Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)

Still same result.. Can anyone help? I'm new in asp classic and vbscript especially in uploading of files and also its behavior. thanks
Posted
Updated 4-Feb-13 4:28am
v2
Comments
ZurdoDev 4-Feb-13 14:47pm    
Something about this is familiar from many year ago. Try using a mapped drive.
Mark Abriel Benedicto 6-Feb-13 9:55am    
I already tried that. Mapped drive didn't work.
jhez25 8-Mar-13 21:30pm    
click this links..
http://stackoverflow.com/questions/14688762/how-to-upload-file-in-external-ip-address-vbscript
lailac88 21-Mar-13 21:49pm    
there is some tips here--http://www.tek-tips.com/faqs.cfm?fid=1869

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900