Solved

Cannot upload file suddenly

Posted on 2008-10-17
3
378 Views
Last Modified: 2013-11-24
Hi

I built a code to upload file and create directory. It did work yesterday. When I run it today, the file cannot be uploaded.

<input type="file" name="myimage">

enctype="multipart/form-data"

boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if(isMultipart)
{
DiskFileItemFactory factory = new DiskFileItemFactory(); //I added a breakpoint here, Source not found for WebappClassLoader.loadClass(String)                   
factory.setSizeThreshold(500000);                  
factory.setRepository(tempPathFile);
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setSizeMax(1000000);      
                  
List /*FileItem*/ items = upload.parseRequest(request);
Iterator /*FileItem*/ i = items.iterator();


Why this happen?
0
Comment
Question by:techques
3 Comments
 
LVL 13

Expert Comment

by:Murali Murugesan
Comment Utility
Do u get any exception messages?..

Probably try deleting the file in the upload directory and try executing ur code.

-Murali*
0
 
LVL 5

Expert Comment

by:deeppra
Comment Utility
post the exception stacktrace
0
 

Accepted Solution

by:
techques earned 0 total points
Comment Utility
Thanks, I fixed it.

As I added some code which cannot let WebappClassLoader.loadClass(String)  get the file path.

The wrong is get the context which is blank, then redirect to another jsp page?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now