Save Directory on Another Machine (Remote Server)

Last post 09-24-2013, 1:18 PM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  09-19-2013, 3:20 AM 77994

    Save Directory on Another Machine (Remote Server)

    Hi

    I'm still new using ASPUploader on my ASP Classic web apps,

    So far ASPUploader is great when uploading file into it's current drive in my web apps, but now i've got a problem when i need to  save my upload file into another drive or another machine/server..

    I try to create folder named "UploadFolder" in another machine/server and share it over network, and change my ASPUploader save directory in my web apps (that using ASPUploader) into:  "\\servername (or IP address)\UploadFolder"  

     

    But  when i try to upload, ASPUploader show an error "Invalid Save Directory! Not exists. At function Ox6c"

     

    I've tried to map network drive, and change my ASPUploader save directory in my web apps (that using ASPUploader) into:  "Z:\UploadFolder" but still got that error "Invalid Save Directory! Not exists. At function Ox6c".

     

    Please help, how can i solve that problems... Thanks  :)

     

    Filed under:
  •  09-19-2013, 1:22 PM 77999 in reply to 77994

    Re: Save Directory on Another Machine (Remote Server)

    Hi zexelgrifone,

     

    The upload file only can save into the current server. can not save it into remote server.

     

    If you want to save it into the different drive of the current server, then use the full  physical path in method CopyTo. Like the example below. And ensure that your site has the write/read permission of the save location.

     

    1. <%@ Language="VBScript" %>  
    2. <!-- #include file="aspuploader/include_aspuploader.asp" -->  
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    4. <html xmlns="http://www.w3.org/1999/xhtml">  
    5. <head>  
    6.     <title>  
    7.         example  
    8.     </title>  
    9. </head>  
    10. <body>  
    11.     <div>                          
    12.             <form id="form1" method="POST">  
    13.             <%  
    14.             Dim uploader  
    15.             Set uploader=new AspUploader  
    16.             uploader.MaxSizeKB=10240  
    17.             uploader.Name="myuploader"  
    18.             uploader.InsertText="Upload File (Max 10M)"  
    19.             uploader.MultipleFilesUpload=true  
    20.             %>  
    21.             <%=uploader.GetString() %>  
    22.             </form>  
    23.               
    24.             <br/><br/>  
    25. <%  
    26. If Request.Form("myuploader")&""<>"" Then  
    27.   
    28.     Dim list,i  
    29.       
    30.     'Gets the GUID List of the files based on uploader name   
    31.     list=Split(Request.Form("myuploader"),"/")  
    32.   
    33.     For i=0 to Ubound(list)  
    34.         Dim mvcfile  
    35.         'get the uploaded file based on GUID  
    36.         Set mvcfile=uploader.GetUploadedFile(list(i))  
    37.         mvcfile.CopyTo("E:/test/"&mvcfile.FileName)  
    38.     Next  
    39. End If  
    40.   
    41. %>  
    42.               
    43.     </div>  
    44. </body>  
    45. </html>  
    Regards,

     

    Ken

  •  09-24-2013, 4:49 AM 78009 in reply to 77999

    Re: Save Directory on Another Machine (Remote Server)

    Thank U for your respond..

    I've try your code, and that's great!  

     

    But still, i have some question..

    1. Does it mean we don't have to set a Save Directory?

    Just like an example in the document :  uploader.SaveDirectory="/myfolder" 

    2. If we don't have to set a Save Directory, where does the file location of my uploaded file before I copy/move it?

    3. If we upload two or more files with the same name,  will it replace the other files?

    Because my site sometimes have 100-1000 concurent users that upload files.

     

    Thank U 

     

     

  •  09-24-2013, 1:18 PM 78012 in reply to 78009

    Re: Save Directory on Another Machine (Remote Server)

    Hi zexelgrifone,

     

    1. Yes, if use method CopyTo and MoveTo, then do not need to use SaveDirectory anymore.

     

    2. The temp file will save into your system temp folder, mostly is "C:\Windows\Temp". You can set property "TempDirectory" to change the temp folder location like uploader.TempDirectory="D:/sites/aspuploader/mytemp/". If you use method "Moveto" to save the file, then the temp file will be removed after saved.

     

    3. It will overwrite the same name file. Method "MoveTo" and "CopyTo" allow you save the file as any name you need, so you can check your exists file names first, and compare with the upload files. you can refer to http://cutesoft.net/forums/thread/72358.aspx, it may help.

     

    Regards,

     

    Ken 

View as RSS news feed in XML