AsyncFileUpload *VERY* broken in the AjaxControlToolkit
I've just downloaded the new AjaxControlToolkit from codeplex to give the much anticipated AsyncFileUpload control a go, but unfortunately it has fallen at the first hurdle...
I have put it on a fairly simple page called uploadFile.aspx which takes a url argument:
uploadFile.aspx?myDbId=1
In the page load, it's doing stuff with Request["myDbId"].
When selecting a file using the new control, it posts it back straight away, but it hits a 500 error with the Request["myDbId"] line because it has stripped开发者_JAVA百科 ALL url arguments and replaced them for it's own:
uploadFile.aspx?AsyncFileUploadID=ctl00_BodyPlaceHolder_ctl00&rnd=08382490910589695
This to me is a massive problem, and one I haven't been able to get around. Any solutions?
Here's an alternate solution if that one doesn't work out. This solution has been around for a year or two, and it is his second version. It includes a progress bar that doesn't require a flash dependency, and can handle very large files without problems.
ASP.Net File Upload Module v2
http://darrenjohnstone.net/aspnet-file-uploaddownload-module-v2-documentation/
Can you use a Session variable to manage myDbId?
You could encode the id in the filename, so just append "--" + myDbId
to the filename. The fact that it comes after the extension could make it easier to know that this was added.
Put the AsyncFileUpload control in an iframe on the page, which will post back to just that section.
精彩评论