• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to force the saving of file to a location

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

can anyone tell me is it possible to force the downloading and saving of files to a particular location or directory..
if yes,how can this be done using jsp/servlet
please help me out solve the problem


regards
santosh
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regardless of whether it is possible or not, how do you know that this location definitely exists in all file systems on every client that may connect to your application?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would you want a website that you've visited to force a download onto your machine?

The people who build browsers, very intentionally, made sure that this was not possible.
 
Santosh Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Sturrock:
Regardless of whether it is possible or not, how do you know that this location definitely exists in all file systems on every client that may connect to your application?



thanx for the concern
actually i am going to store the file on the server so there is a definite location for it
all the users should be forced to store the file in that location only
how can it be done using jsp/servlet
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you don't actually mean download? Are you asking how to upload a file to the server?
 
Santosh Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Sturrock:
So you don't actually mean download? Are you asking how to upload a file to the server?



actually i need to force the download of files from internet ( or saying saving of file )to my required location on the local server.
how can it be done
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. So what you want to do is download a file from a location to the server your web app is running on, rather than to the web app client? Well you could use a URLConnection object to connect to the remote server you want to use, read in the file as a Stream, and write it to the FileSystem (just as you would any file). Does that make sense?


or saying saving of file


Not sure what you mean by that.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic