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