• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

open pdf file in jsp

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i have made a jsp in which i made a button "view" and i have a pdf on my local machine. Ii want to open pdf file on click of view button. I used onclick property and tried in javascript window.open("test.pdf") but it is not opening my pdf. please help

Thanks in advance:)
Lokesh
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Web applications have no access to local files. If the user wants to open a PDF, can't he just double-click it in his file explorer?
 
lokesh jain
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that ulf, however in my application, when i click on make, it makes a pdf file in client's D: drice...but on click of view..my client wants to view that file. So how to achieve this thing? Can you Suggest?

Thanks in advance
Lokesh
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A web app can't create a file on the client's machine. It can stream PDF data that the browser decides to save on the client machine, IF the user at some point instructed the browser to save all PDFs automatically. Otherwise, the browser will open a little dialog, asking the user whether to open the file with some application, or to save it.
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic