You can store uploaded files also to a network disk or network resource. The main problem within this task are user rights. The default user account running ASP script (usually IUSR_COMPUTERNAME) has no access to network resources. One of the way is to connect to a network resource with another Username and Password (using
AddConnection), store uploaded files and Disconnect from the resource (
CancelConnection). This is a sample VBScript concept of the task. See
upload-network.asp sample for full code.
|
| ASP - upload and store files to a network drive | |
|---|
'Create ASPForm object
Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
'was the Form successfully received?
If Form.State = 0 Then 'completed
'Connect to a network resource using username and password
Form.AddConnection "\\servername\sharename", "administrator", "password"
'Save uploaded files to the network disk
Form.Files.Save "\\servername\sharename\folder"
'You can disconnect the network resource here.
Form.CancelConnection "\\servername\sharename"
End If |