Ajax Submit Timeout

Ajax Submit Timeout

Ok, so I'm having a weird error while executing an Ajax Submit action.

The scenario:
Typical export to Excel action in a screen (action gets the data in an advanced query with only the required outputs, RecordListToExcel the full output from the query and then a Download to disk to end the action, nothing fancy) but the link for the action being an Ajax Submit  

Was testing the feature, got an client script exception: "Error: The connection to the server was reset"

Though to myself, around 25k lines to export, probably the query is too slow, lets hack the time of the request.

Added the SetRequestTimeout action from HTTPRequestHandler extension, with -1 (infinite) timeout.

Restested, same output.

Timed it, 40 seconds after the request starts and the error pops out

Changed the link to a submit, 14 seconds in and I get the Save as dialog to save the file to disk...

So, 3 questions arose to me:
  • why would the ajax give a timeout about 3x later then the submit version?
  • is there a limitation to create a download on a ajax? I've never seen any information on this. Does the Ajax for some reason tries to download the entire file or something?
  • the SetRequestTimeout doesn't work in Ajax requests? If so is there an equivalent for Ajax requests?
Any thoughs would be appreciated.
Imho, you cannot do a download in an ajax-submit in a straightforward manner.

Because you will have issues with headers already sent etc.
Hence you have to create something obscure.

The Download Action must be done in a "Submit", not an "Ajax Submit".