-1

I have written this in web.config:

<httpRuntime maxRequestLength="10240" executionTimeout="30" />

On client side I'm using valum's AjaxUpload plugin. When using IE 9 I can't check uploading file size with JavaScript, because IE 9 does not support this. So if I upload large file with IE, server will throw exception because of above setting written in web.config. How can I catch this exception and show message to user? thanks in advance

karaxuna
  • 26,752
  • 13
  • 82
  • 117
  • The response code should be different from the server (200), you should be able to catch the response code to present your message – Bloafer Jun 06 '13 at 11:07
  • The plugin is using hidden iframe, so I cannot get status code. Additionally it throws this error only when exception is thrown on server side: `Unsafe JavaScript attempt to access frame with URL data:text/html,chromewebdata from frame with URL [my url]. The frame requesting access has a protocol of 'http', the frame being accessed has a protocol of ''. Protocols must match.` – karaxuna Jun 06 '13 at 11:09
  • What version of this plug in? It sounds like you may be using an old non-official version. – Ray Nicholus Jun 06 '13 at 11:39

2 Answers2

0

On this page Ajax Upload using valums ajax upload plugin inside a form could you not use the onComplete section to find the response code?

onComplete: function(file, response) {
    // --- stuff here too
}
Community
  • 1
  • 1
Bloafer
  • 1,324
  • 7
  • 12
0

If you are using valums file uploader then you can specify file size limit in plugin options.

sizeLimit: 0, // max size   
minSizeLimit: 0, // min size

And in case of any error you also can handle it onError: function()...

k-s
  • 2,192
  • 11
  • 39
  • 73