This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Upload code from this site 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 » Servlets
Bookmark "Upload code from this site" Watch "Upload code from this site" New topic
Author

Upload code from this site

Christopher Jursa
Greenhorn

Joined: Jul 19, 2004
Posts: 4
Hello,

I have an abnormal question for regular visitors.

I am creating a web site that requires the user to upload a file to our server to be processed. One of my former co-workers used some code she found on the Internet. I can't find out where for the life of me.

However, I noticed a jar file she uses entitled "javaranchCommonPart1.jar", which is why I am here.

Does anyone know what files (from this site) she may have used? Is this jar file a common file in an upload script from this site?

Thanks for humoring me!

Cheers,

Chris
Divij Mahajan
Greenhorn

Joined: Jul 26, 2004
Posts: 8
Hey Chris

Two ways to use servlets to upload using MIME types are

- application/x-www-form-urlencoded
- multipart/form-data

The third is to use a FileUpload API. U can get one from http://jakarta.apache.org/commons/fileuploads.

To checkout a few examples of how to write a servlet class using these APIs, please refer the following books

1. OReilly's "Java Servlet Programming"
2. Servlets and JSPs - The JeEE Technology Web tier" by Jayson Falkner and Kevin Jones.

Let me know if you still have queries.


Cheers!!


-Divij<br />---------------------------------<br />Weinberg's Law: If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upload code from this site
 
Similar Threads
PrimeFaces uploadFiles
Max upload file size?
Disabling File Reaper in commons-io-1.0
File access
.CSR file is not accepting