• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to force the saving of file to a location  RSS feed

 
Santosh Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!