Possibly before $ .post and get the file upload dialog back
I don't think this is possible using pure Ajax. You will need to redirect the browser to the file share somehow. (See my final starting point for a possible exception to this rule.)
What can you do:
-
Get the url of the file and redirect it in the callback
success
:location.href='...'
-
Return the url of the file and set it as
src
newly creatediframe
(to prevent the current page from closing / freezing)$("#iframe").attr("src", "....");
-
Maybe - I haven't used it myself yet, but it looks like it can do it - get the data and do a local file download using Doug Neiner Downloadify
a source to share