I have an ASP.NET web form to get name, email address and uploaded filename(s). Added an AjaxFileupload control (ASP.NET AJAX Toolkit v16.1 not to be confused with AsyncFileupload or ASP.NET FileUpload control) that works OK because it lets you upload files without doing any Postback at all avoiding to submit the same form more than one time (See sample here: Upload files and images without page PostBack / Refresh / Reload in ASP.Net - )
The control works fine, it saves the files but the problem is: once the fields in the form are validated, the file(s) are uploaded and I'm finally ready to Submit the form I can't get the path of the uploaded files because the AjaxFileUpload control doesn't have any method to do that :(
In other words you can't simply invoke AjaxFileUpload.GetListOfUploadedFiles() and get an ArrayList of uploaded files. I want to save all the fields on a record, name, email and all the filenames that this user has been uploaded so I can use this data to make a report.
Protected Sub OnUploadComplete(sender As Object, e As AjaxFileUploadEventArgs)
Dim fileName As String = Path.GetFileName(e.FileName)
Me.AjaxFileUpload1.SaveAs(Server.MapPath("/output/" & fileName))
End Sub
I've tried to catch the filenames there but once one file gets saved and you left the Sub the data is gone, so here is my question:
How can I do to get a String with all the files listed on the "uploaded files" section of the AjaxFileUpload control so when I Submit the form I can get all those filenames?
I've seen something related to that using Javascrit to change behaviour on queued files here: AjaxFileUpload automatically upload file once selected perhaps there is something like "Sys.Extended.UI.AjaxFileUpload.prototype._QueuedFiles" that I can use to get the filename list at the time of submitting the form.
Thanks!
PS: Save the binaries on the DB is out of the question because it means a hugue increase on database size since there will be several users each one uploading files about 6Mb each thus increasing DB size.