|
-
FileUpload problem
I have use the fileupload package and encountered error on this line in bold.
DiskFileItemFactory factory = new DiskFileItemFactory();
// maximum size that will be stored in memory
factory.setSizeThreshold(4096);
// the location for saving data that is larger than getSizeThreshold()
factory.setRepository(new File("/tmp"));
ServletFileUpload upload = new ServletFileUpload(factory);
// maximum size before a FileUploadException will be thrown
upload.setSizeMax(1000000);
List fileItems = upload.parseRequest(request);
// assume we know there are two files. The first file is a small
// text file, the second is unknown and is written to a file on
// the server
Iterator i = fileItems.iterator();
String comment = ((FileItem)i.next()).getString();
FileItem fi = (FileItem)i.next();
// filename on the client
String fileName = fi.getName();
// save comment and filename to database
// write the file
fi.write(new File("/www/uploads/", fileName));
Error catch:
org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. \tmp\upload_144f6414_11f26db7ce1__7ff8_00000000.tmp (The system cannot find the path specified)Processing of multipart/form-data request failed. \tmp\upload_144f6414_11f26db7ce1__7ff8_00000000.tmp (The system cannot find the path specified)
Similar Threads
-
By ramki16 in forum ASP.NET
Replies: 5
Last Post: 11-17-2008, 10:13 AM
-
Replies: 11
Last Post: 11-16-2007, 12:23 PM
-
By Shannon in forum VB Classic
Replies: 7
Last Post: 06-24-2007, 08:47 PM
-
By dbrook007 in forum ASP.NET
Replies: 0
Last Post: 11-06-2006, 04:54 AM
-
Replies: 0
Last Post: 12-13-2001, 12:06 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks