javascript - Download file directly, not from window.open(url) -


i'm having session issues in asp.net application. main application opens asp.net dialog, contains link pdf file. file 'downloaded' using window.open('myurl/file.pdf');

this results in new window opening, file cannot downloaded due session object not transferred (keep in mind solution bit more complex, trying keep session in new window not work because it's embedded in c# webbrowser frame).

are there possibilities downloading file directly link, not through window.open()?

if file exists on file system, link it. know winds opening file in browser depending on user's setup.

if don't want through opening window , file generated dynamically:

  1. use button or linkbutton
  2. use response.addheader in click event of button/linkbutton

        response.addheader("content-disposition", "attachment;filename={filename.extension}") response.contenttype = "application/{mime type here}" 
    1. stream results client (you'd need up, lot excel streaming datagrids not pdfs)

this should prompt user do...


Popular posts from this blog