This is a migrated thread and some comments may be shown as answers.

[Solved] IE and file size exceeded

4 Answers 115 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sorina
Top achievements
Rank 1
Sorina asked on 09 Dec 2011, 03:37 PM
Hi,

I would like to be able to display the user a proper error message when the file size he is trying to upload is exceeded, and a general message otherwise.
In Firefox and Chrome it works well, since onUpload I can check the file size and cancel the upload if it is exceeded.
And for the general error case, I display an error message in onError.
On IE, the file size check does not work, so I need to rely on server side checking.
I would like to know if it is possible to see the original error message in onError and if it is possible to remove the "Try again" option if my error message says that file size is exceeded.

Cheers,
Sorina

4 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 12 Dec 2011, 01:56 PM
Hi Sorina,

The server response should be accessible through e.XMLHttpRequest.responseText

The Retry button can hidden using jQuery:

function onError(e) {
    $(".t-button:has(.t-retry)", this).remove();
}

I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Sorina
Top achievements
Rank 1
answered on 12 Dec 2011, 01:59 PM
Hi Tsvetomir,
Thanks a lot!
Could you also tell me where can I find the error message coming from the server? I have been looking with no luck so far.
Many thanks,
Sorina
0
T. Tsonev
Telerik team
answered on 13 Dec 2011, 09:05 AM
Hello Sorina,

I'm glad it worked. Have you tried accessing the error message through e.XMLHttpRequest.responseText as suggested?

Greetings,
Tsvetomir Tsonev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Sorina
Top achievements
Rank 1
answered on 13 Dec 2011, 09:29 AM
Hi Tsvetomir,
I had to add the customErrors tag to web.config and set it to "off" in order to be able to receive the error message in e.XMLHttpRequest.responseText as you suggested.
Thank you very much!
Cheers,
Sorina
Tags
Upload
Asked by
Sorina
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Sorina
Top achievements
Rank 1
Share this question
or