UPload file to other server

MisterB

Newcomer
Joined
Oct 18, 2005
Messages
17
Location
The Hague, The Netherlands
Hi Reader ;)

I've got I question about a fileupload control.

In my webapp. I've got a fileuploadcontol that uploads the file to a folder on the webserver ( eg. C:\Inetpub\wwwroot\UploadedFiles) NOW.... what i want is.. if a file is uploaded it is uploaded to another server ( the server where the webapp runs on is eg myserver so the upload folder is myserver\uploadedfiles and i want it to be stackserver\files )

I would like to do this because the webserver has virtualy no HD space and the stack server has several TB (:D:0)

any idears???

Tnx
Mrb
 
The fileupload control is designed to upload to the webserver hosting the page. You could simply handle the event on the server side and once the file has been uploaded move it to the correct place.
 
Found it :)

here is the code

Code:
 '-- Moving a file
        Dim fs, f
        fs = Server.CreateObject("Scripting.FileSystemObject")
        f = fs.GetFile("c:\test.txt")
        f.Move("\\Myserver\Uploads\test.txt")
        f = Nothing
        fs = Nothing
'-- Moving a folder
        Dim fs, fo
        fs = Server.CreateObject("Scripting.FileSystemObject")
        fo = fs.GetFolder("c:\test")
        fo.Move("c:\asp\test")
        fo = Nothing
        fs = Nothing
 
Back
Top