Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upload code from this site

 
Christopher Jursa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic