Solved

Cannot upload file suddenly

Posted on 2008-10-17
3
385 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
ID: 22755131
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
ID: 22755414
post the exception stacktrace
0
 

Accepted Solution

by:
techques earned 0 total points
ID: 22758310
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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
word0 challenge 4 70
difference between sorce folder and folder in eclipise 3 28
jsp error 6 25
maven not picking latest jar instead picking old jar from .m2 12 18
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

856 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