?
Solved

Cannot upload file suddenly

Posted on 2008-10-17
3
Medium Priority
?
395 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
[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
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

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.
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

770 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