Two Laptop Bag*
The moose likes JSP and the fly likes uploading a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "uploading a file" Watch "uploading a file" New topic
Author

uploading a file

jyotsana dang
Ranch Hand

Joined: Sep 26, 2003
Posts: 135
any idea how do we allow users to upload their files using JSP..
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
jyotsana -
just go to the search link and you will find tons of information related to it. This topic is very popular here.
regards


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
In brief, I would say, checkout JSPSmart Upload & com.oreilly components.
hth
MB


Malhar Barai
SOA & Java Book
Ajith Pande
Greenhorn

Joined: Nov 10, 2003
Posts: 2
Hi,
Uploading file into hard drive is very simple
here some sample code
---------------in jsp--------------
<input type=file name=...>
----------------------------------
---in java-----------
import com.oreilly.servlet.MultipartRequest,
java.io.File file = multipartRequest.getFile("file");
file.renameTo(new java.io.File("c:\newfile"));
//here u need not to create that file, it wll create itself .it jsut like coping file
//and one more thing pls put cos.jar file into lib dir and add it to classpath
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: uploading a file
 
Similar Threads
upload .tiff file
datastream with additional parameter
to store user uploaded photos
sending a file to servlet
calling getInputStream after getParameter