Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 21, 2013 02:33 AM by chetan.sarode
0 Points
7 Posts
Jan 18, 2013 06:27 PM|LINK
Here is my code - I simplified everything just to debug - but no chnage
<td valign="top"> <asp:label id="lblFile" runat="server" Font-Bold="True">File to Upload:</asp:label> </td> <td> <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" OnClientUploadComplete="UploadCompleteClient" OnUploadComplete="ajaxUpload_OnUploadComplete"/> <br /> <asp:Label ID="lblError" runat="server" Font-Bold="true" ForeColor="Red" Visible="false"></asp:Label> <br />
then server side
protected void ajaxUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filePath = Server.MapPath("~/images/") + e.FileName; // YOUR CODE TO SAVE THE FILE NAME IN DATA BASE AjaxFileUpload1.SaveAs(filePath); }
then script - which does not fire either
function UploadCompleteClient(sender, args) { try { alert("Success: UploadCompleteClient"); } catch (e) { alert(e.message); } }
Member
612 Points
149 Posts
Jan 18, 2013 06:58 PM|LINK
Is this happening only for large files?
You can increase the allowed size in the web config
(max)
<system.web> <httpRuntime maxRequestLength="600000"/> </system.web>
Jan 18, 2013 08:45 PM|LINK
It happens on 64k files. I know that something must be wrong but after two days I am lost.
Thanks
All-Star
65839 Points
11163 Posts
Jan 21, 2013 02:33 AM|LINK
You can use OnClientUploadError The name of a JavaScript function executed in the client-side if the file upload failed.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx
Had to add
<httpRuntime maxRequestLength="xxxx" executionTimeout="3600" />
aussieracer
0 Points
7 Posts
AjaxFileUpload not working - shows uploading % then freeze - no transfer
Jan 18, 2013 06:27 PM|LINK
Here is my code - I simplified everything just to debug - but no chnage
<td valign="top"> <asp:label id="lblFile" runat="server" Font-Bold="True">File to Upload:</asp:label> </td> <td> <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" OnClientUploadComplete="UploadCompleteClient" OnUploadComplete="ajaxUpload_OnUploadComplete"/> <br /> <asp:Label ID="lblError" runat="server" Font-Bold="true" ForeColor="Red" Visible="false"></asp:Label> <br />then server side
protected void ajaxUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string filePath = Server.MapPath("~/images/") + e.FileName; // YOUR CODE TO SAVE THE FILE NAME IN DATA BASE AjaxFileUpload1.SaveAs(filePath); }then script - which does not fire either
function UploadCompleteClient(sender, args) { try { alert("Success: UploadCompleteClient"); } catch (e) { alert(e.message); } }Specs
Member
612 Points
149 Posts
Re: AjaxFileUpload not working - shows uploading % then freeze - no transfer
Jan 18, 2013 06:58 PM|LINK
Is this happening only for large files?
You can increase the allowed size in the web config
(max)
aussieracer
0 Points
7 Posts
Re: AjaxFileUpload not working - shows uploading % then freeze - no transfer
Jan 18, 2013 08:45 PM|LINK
It happens on 64k files. I know that something must be wrong but after two days I am lost.
Thanks
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: AjaxFileUpload not working - shows uploading % then freeze - no transfer
Jan 21, 2013 02:33 AM|LINK
You can use OnClientUploadError The name of a JavaScript function executed in the client-side if the file upload failed.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx
Had to add
<httpRuntime maxRequestLength="xxxx" executionTimeout="3600" />
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.