When uploading an empty file with the upload control set to Azure mode an error occurs. I can also no find an easy way to change this error message, validate the file size before hand (using upload control in advanced mode, so the file inputs FileList is empty for some reason once you upload a file) or ideally to just allow the upload of an empty file.
The full error message you get is in the format - "Bad request. StatusCode: BadRequest RequestResult: InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format. RequestId:d071a4d8-0001-0007-085c-fb4156000000 Time:2015-09-30T08:49:25.0490557ZContent-Length0"
It could also be helpful to provide a client side event for when an error like this occurs so you can perform some action depending on the error, is this available?
I assume this is a bug? You can recreate this by creating an empty file (" fsutil file createnew filename 0" in the command line) and try to upload this to azure using an Upload control set to use Azure mode.
Hello,
I was able to reproduce this issue and passed this ticket to our developers for further research.
We will update this ticket as soon as we get results.
Regarding your question about error handling - there are no such error handlers on the client side but you can handle these errors in Global.asax, for example, the following code will display the "Cloud upload failed." string:
protected void Application_Start() { ... DevExpress.Web.ASPxWebControl.CallbackError += Application_Error; } protected void Application_Error(object sender, EventArgs e) { var exception = HttpContext.Current.Server.GetLastError(); if (exception.Message.Contains("Bad request")) DevExpress.Web.ASPxWebControl.SetCallbackErrorMessage("Cloud upload failed."); }
Please refer to the Handling Callback Exceptions on Server | ASP.NET Controls and MVC Extensions | DevExpress Help documentation article to learn how to handle errors in the Global.asax file.
Hi,
I tried your solution to update the error message but the Application_Error would not get hit on a CallbackError.
When I try to upload an empty file with a breakpoint in the Application_Error method, the breakpoint will not get hit and the message will stay as it originally was.
I would upload a demo project but it won't let me upload a file more than 30MB
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T296086: CallbackError event handler is not invoked on callback error. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.