[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to upload an image in Java servlets

Posted on 2004-04-07
10
Medium Priority
?
20,453 Views
Last Modified: 2013-11-24
Hi,
I am new to Java Servlets programming.I am using Windows platform,Oracle HTTP Server(Servlet enabled).Can u please give me code to how to upload the images from a web Form to a server directory.I am trying to write the code using Servlets.
Thanks
Aayushdeep Garg
Web:
http://profile.iiita.ac.in/adgarg_02
0
Comment
Question by:aayush123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
10 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 10781435
I don't think that I understand your question properly. Does this help you?:

http://otn.oracle.com/sample_code/tech/java/servlets/htdocs/vsmfilters/fileupload.html
0
 

Author Comment

by:aayush123
ID: 10781473
I want the code thst will be on the server for uploading an image from my web form to the server.The code will be written in servlets for file uploading on the sever.It willbe executed on the server on pressing the submit button.
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 120 total points
ID: 10781685
Did the link that I posted, help? If not, try the code at this page:

http://forums.devshed.com/archive/t-122423
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 30

Expert Comment

by:Mayank S
ID: 10781688
Add a doPost () method to it as well.
0
 

Author Comment

by:aayush123
ID: 10784835
Hi,
The code given at:
http://otn.oracle.com/sample_code/tech/java/servlets/htdocs/vsmfilters/fileupload.html
 
is not useful to me.
but I like something given at
http://forums.devshed.com/archive/t-122423
but it is not running and not understandable also.Please give another example.
Thanks.
Aayushdeep Garg
Web:
http://profile.iiita.ac.in/adgarg_02
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10789417
What error is it giving? Any specific compilation errors/ runtime exceptions? If so, please post the code along with the error messages and tell at which line you are getting the error.
0
 
LVL 3

Assisted Solution

by:mjzalewski
mjzalewski earned 120 total points
ID: 10805763
For a good snap-in component (open source), you might want to try

Apache Jakarta Commons FileUpload Component
http://jakarta.apache.org/commons/fileupload

I like this one because you can upload to memory or disk, multiple files at a time, and there is a forum where you can ask questions.

0
 
LVL 30

Expert Comment

by:Mayank S
ID: 10978153
Please proceed with that recommendation.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question