开发者

AjaxControlToolkit's AsyncFileUpload misbehaving when deployed online

In case it matters, the following is inside a toolkit popup, which has an update panel in it.

<p>
    <asp:Label Text="Picture" runat="server" Width="75"></asp:Label>
    <ajaxToolkit:AsyncFileUpload ID="MediaPicture" runat="server" Width="200"
        OnClientUploadStarted="BlockSubmits" ClientIDMode="AutoID"
        OnClientUploadError="UnblockSubmits" PersistFile="true"
        OnClientUploadComplete="UnblockSubmits" 
    />
</p>
开发者_运维问答

The javascript functions just block / release a submit button, to prevent problems during uploads.

This works fine on localhost, but when deployed online on a GoDaddy server, I can't seem to upload files over a few KB, even when locally I could upload bigger files (~2MB)...

I can't seem to find the reason for this behavior, could it be on the IIS? I read something about the app pool clearing before the upload could complete, could this be happening?

Btw, just in case, server-side I just take the picture out of this control

byte[] picture = MediaPicture.FileBytes ?? (string.IsNullOrEmpty(mediaID) ? null : Media.SelectByID(int.Parse(mediaID)).GetPicture());

There's some extra logic in there about whether I'm in edit mode or not, and if the current record has a picture, I'll take that over no picture,

And then I store it on the database.

any thoughts as to why this might be happening?

thanks!


If I understand your situation correctly, the problem is caused by the AsyncFileUpload being located inside the updatepanel, thereby having the file upload happen during a postback...

This blog post has a decent explanation of why.

As for why it works locally, if it is the problem as explained above, it's because of the way the browser handles "local" from "internet" domains.


The Assync upload of the ajax toolkit still has to have a post with the maximum request size of ASP.NET.

This max size is setted in the web.config of your application AND inside IIS. Since you are using a third party provider... try to fiddle with the web.config in the section

<httpRuntime maxRequestLength="40960"/>

If this won't help you out, check out the SWFUpload control... saved my skin a couple of times.

Regards,


I guess you use different IIS versions in your development environment and in the the production server (in this case Go Daddy).Can you verify and let me know the exact IIS versions so that I can provide you a better solution? Cause IIS 7.0 has a slightly different configuration than IIS 6.0.


I was experiencing the exact same problem, but including the website in the "Local Intranet" zone in IE the security setting was a workaround.

However, I updated the Ajax Control Toolkit and the problem was completely solved. There is no more need to mess with the security setting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜