0

Hi,

I am using VS-2005.
In my website I have used the html input control with type=file.

The problem is that when I place this control inside an 'UpdatePanel' the 'PostedFile' property becomes 'Nothing' on postback. So in order to get things working I have removed the 'UpdatePanel' and things are working fine.

However, I am interested to know what kind of workaround is required if I were to use an 'UpdatePanel'? In one of the threads at forums.asp.net I found that we need to set a 'PostBackHandler' for the update panel. I have no idea how to implement this. Does it refer to 'AsyncPostbackTrigger' or 'SyncPostBackTrigger'?

Can someone give an idea how to implement this?

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by toddanglin
0

This is a Major drawback of asp.net which is not capable of providing this piece of functionality.

search on google this is a legendary problem since 2005 came in..!

i.e the reason why ppl switch to Telerik Controls.

0

Hi Ashish,
I was able to resolve the issue.
I had to set the trigger to 'PostBackTrigger' instead of 'AsyncPostbackTrigger' inside the UpdatePanel for the 'Upload' button.

0

In general, you cannot upload files with Ajax. This is simply a limit of HTTP and browsers. The only way to upload files asynchronously are:

  1. By using a browser plug-in (like Silverlight)
  2. By using a hack that "secretly" POSTs the file (IFRAME)

This article well describes the common IFRAME workaround used to enable "async" file uploads in standards-based sites:

http://www.openjs.com/articles/ajax/ajax_file_upload/

If you prefer a tool, you can use things like RadAsyncUpload for ASP.NET to achieve the same effect with less manual code:

http://demos.telerik.com/aspnet-ajax/upload/examples/async/ajaxprocessing/defaultcs.aspx

Hope that helps.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.