File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes FileUpload using DiskFileUpload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "FileUpload using DiskFileUpload" Watch "FileUpload using DiskFileUpload" New topic

FileUpload using DiskFileUpload

Visu Guri

Joined: Oct 06, 2004
Posts: 2

I am trying to upload a .xls file using DiskFileUpload.The code snippet is as follows.

DiskFileUpload upload = new DiskFileUpload();

// Set upload parameters

// Parse the request
List /* FileItem */ items = upload.parseRequest(request);

If I try to print size and items in the List its displaying 0 and [ ] respectively.
Your valuable help can be appreciated.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

Moved to the Servlets forum.

[Asking smart questions] [About Bear] [Books by Bear]
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225
Can you post the html code? Have you set the enctype attribute of 'form' to multipart/form-data ?
I agree. Here's the link:
subject: FileUpload using DiskFileUpload
It's not a secret anymore!