Post Back For AjaxUploader MVC

Last post 02-07-2013, 12:24 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  02-06-2013, 10:43 PM 76813

    Post Back For AjaxUploader MVC

    I would like to gather additional information about the files a user plans to upload, but cannot see how to accomplish this.  I would like to reload the page but preserve the uploaded files in their temporary file location in order to gather more inofrmation about them.  I am using a .NET MVC4 project.  In the following code there is a commented statement.  "You should validate it here:"  What do people do if in their validation the files are not proper?  How do they pass the string myuploader back to the form so that the uploader recognizes it, so that the user does not have to choose his files again.  What I am planning on doing is checking for the additional information that I would like based on the files submittted, so that I can then name them properly and place them in the proper place on our server

     

    Hope what I am asking makes sense 

     

                       foreach (string strguid in myuploader.Split('/'))
                       {
                           Guid fileguid = new Guid(strguid);
                           CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(fileguid);
                           if (file != null)
                           {
                               //you should validate it here: 
                               //now the file is in temporary directory, you need move it to target location
                               //file.MoveTo("~/uploads/AdditionalServices/" + file.FileName);
                               processedfiles.Add(file.FileName);
                               System.Diagnostics.Debug.WriteLine("processedfiles.Add - " + file.FileName);
                           }
                       }
     

  •  02-07-2013, 12:24 PM 76816 in reply to 76813

    Re: Post Back For AjaxUploader MVC

    Hi burley325,

     

    If you requirement, I suggest you catch the upload error then handle it by your own login. Please refer to  http://www.ajaxuploader.com/document/scr/html/How-to-catch-uploader-error.htm, the upload file will be a parameter there, so do not need to set it back to the form.

     

    Regards,

     

    Ken 

View as RSS news feed in XML