Upload folder

Last post 05-20-2009, 8:48 AM by delamitry. 6 replies.
Sort Posts: Previous Next
  •  01-30-2009, 2:27 PM 48241

    Upload folder

    Instead of having the Ajax Uploader send the file to a temp directory and then copy the file from the temp directory to the destination directory is there a way to have the file uploaded directly to the destination directory?
     
    Note: I don't want the file to be saved as persisted.ac963f8b-0345-434c-b964-5fd86a19bb16.ESCI_Electonic_feedback_survey.doc.resx in the destination folder.
    I want to be able to rename the file the user is uploading so I can remove any unwanted characters?
     
    Say the user was uploading a file called: test#abc%123.xls I want to rename the file to be test_abc_123.xls when it gets saved to the destination folder.
  •  02-02-2009, 11:05 AM 48261 in reply to 48241

    Re: Upload folder

    demmett,
     
    The temp files are used by AjaxUploader internal. Once the files are uploaded, the temp files will be removed from your server automatically.
     
    >>Say the user was uploading a file called: test#abc%123.xls I want to rename the file to be test_abc_123.xls when it gets saved to the destination folder.
     
    Please use the .CopyTo method and rename the uploaded files.
     
    For example:   //args.CopyTo("c:\\temp\\test_abc_123.xls");
     void Uploader_FileUploaded(object sender, UploaderEventArgs args)
            {
                Uploader uploader = (Uploader)sender;
                InsertMsg("File uploaded! " + args.FileName + ", " + args.FileSize + " bytes.");
                
                //Copies the uploaded file to a new location.
                //args.CopyTo("c:\\temp\\"+args.FileName);
                //You can also open the uploaded file's data stream.
                //System.IO.Stream data = args.OpenStream();
            }

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-02-2009, 12:59 PM 48264 in reply to 48261

    Re: Upload folder

    Adam,
     
    Yes, I understand that you can have the file uploaded to the temp directory and then moved to the destination folder, but some of the files my users are uploading are 400mb.
    If they upload 10 files at 400mb it takes the page a little bit of time before it refreshes to show the files have been uploaded.
    My concern is the delay after the upload progress bar goes away (all files have been uploaded to temp directory)  and the page refreshing the gridview to show the files have been uploaded.
     
    How can I add a second progress bar to show how much time is left in copying the files from the temp folder to the destination folder.
    If I could upload directly to the destination folder, we would not need the 2nd progress bar.
     
    Any help would be greatly appreciated.
  •  02-02-2009, 3:44 PM 48272 in reply to 48264

    Re: Upload folder

    Hi,
     
    While the server side process the FileUploaded event, the client side would not get the progress of the server side work.
     
    You can use MoveTo() , it's much faster then copying a file.
     
    If you want to show progress, you can move to another temp folder at first, and then use ajax to do your file processing logic.
     
    Regards,
    Terry
  •  05-19-2009, 5:45 PM 52333 in reply to 48261

    Re: Upload folder

    Adam,
     
    I hade a client upload 6 files.  All six where uploaded to the temp folder but only one made it to the final destination folder.
     
    1) How long does it take to move files over?
     
    2) What would cause the files from being moved over?
     
    Thanks,
     
    Ed
  •  05-19-2009, 6:00 PM 52334 in reply to 52333

    Re: Upload folder

    Adam,
     
    Scratch that.  Evidentially the files do not copy until all files are done uploading.
  •  05-20-2009, 8:48 AM 52354 in reply to 52334

    Re: Upload folder

     
    I've successfully used the FileValidating event which gets fired after each upload.
View as RSS news feed in XML