File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using jsp to copg files from a directory

 
Yinka Olicks
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers,
pls I am writing an application using jsp and tomcat1.4,the application is supposed to connect to a database(oracle),pick up the path to a file,which is stored as a string in a table in the database,then follow the path and copy the file into a seperate folder,the connection to the database and picking up of the path I can do but,following and copying the file on to a different folder I cant pls how do I accomplish this
thanks
thanks I need to copy from the server to the client machine
[ August 17, 2005: Message edited by: Yinka Olicks ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that your intention is to copy the files around on the server (and not the client), you'd just use plain old Java I/O like any other files.
 
Yinka Olicks
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tanks I am copying from server to a client machine and how can is it possible to use http to copy files with jsp thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That you cannot do. Imagine a world where any random web page that you visit could write whatever it wanted to your system. Scary, no?

What you can do is to provide a link to the file that the user can click and download at his or her discretion.
[ August 17, 2005: Message edited by: Bear Bibeault ]
 
Yinka Olicks
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,but what if I just want to use jsp to copy from a system on the network to another system within the network,please how do I go about that thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing specific in JSP for moving files.
There are APIs in Java for dealing with files (java.io.*) and there are various libraries available for dealing with FTP, and networking in general.
IE: http://jakarta.apache.org/commons/net/

Your approach will depend on factors such as OS you're running, what kind of network you have, and your applications specific requirements.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the I/O forum.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic