This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes uploading file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "uploading file" Watch "uploading file" New topic
Author

uploading file

Manaspratim Mitra
Greenhorn

Joined: Dec 27, 2005
Posts: 3
how does one write a servlet that uploads a file?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Turns out, this question is actually HTML-specific.

Short tutorial.


A good workman is known by his tools.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Now that I think of it, your servlet will need to do some processing.

You can either write your own code or copy what has already been done.

See MultipartRequest for an example.

So maybe this thread could be moved to Servlets instead of HTML, but it still isn't related to anything on the SCWCD exam.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15362
    
    6
Moving to servlets....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

There is a JSP FAQ entry on this subject.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

http://faq.javaranch.com/view?FileUpload


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
chloe wong
Greenhorn

Joined: Aug 02, 2006
Posts: 17
you want to upload to a physical location or into BLOB table?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

chloe,
This post is almost a month old.
It's probably safe to assume that the original poster had solved his problem and moved on.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

"amateur83",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The first screen name you had was valid.
Why did you change it?
chloe wong
Greenhorn

Joined: Aug 02, 2006
Posts: 17
oops, sorry. Already changed back my displayed name.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: uploading file
 
Similar Threads
Creating a file by giving relative path
WA #1.....word association
java io
Struts FormFile (parsing .csv files)
performance issues with file read and write