Solved

Cannot upload file suddenly

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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
strDist challenge 35 135
table example 4 33
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO) 1 61
how to debug htl and js pages 8 58
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…
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 …
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.

726 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