Solved

Cannot upload file suddenly

Posted on 2008-10-17
3
381 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
scoresSpecial  challenge 13 46
stringclean challenge 26 70
thymeleaf natural templating vs JSP 2 66
custom annotations 9 29
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.

919 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

19 Experts available now in Live!

Get 1:1 Help Now