jquery - Calling server method opening file from AJAX -


i calling server webmethod opens byte array in notepad.

httpcontext.current.response.outputstream.write(buffer, 0, buffer.length); httpcontext.current.response.flush(); httpcontext.current.response.end(); 

when call method ajax code getting executed it's not openning calling through regular ajax post method.when call throgh server submit it's working.

that because can't download file through ajax... best alternative is, guess, instead of doing request through ajax, insert invisible iframe in page source set "file download" script you're calling.

this solution javascript triggered , open file download dialog you're expecting.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -