commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Norris" <thechrisproject.li...@gmail.com>
Subject [fileupload] getting the simplest case to work
Date Wed, 14 May 2008 20:34:10 GMT
Hi, I'm having trouble getting started with the FileUpload project.  I
have a service (hooked up via CXF) that does the following for a post
request:

			boolean isMultipart = ServletFileUpload.isMultipartContent(request);
			if(isMultipart)
			{
				ServletFileUpload upload = new ServletFileUpload();
				FileItemIterator iterator = upload.getItemIterator(request);
				System.out.println(iterator.hasNext());
			}

The request is multipart, but the item iterator is always empty.  I've
tried submitting the request in three different ways: first from an
Adobe Lightroom plugin (which is what I'm working on), then from a mac
command-line curl call, then from a simple form, which I can reproduce
here:

<html>
<head><title>testing</testing></head>
<form
	action="http://cjn-pc.widen.com:8080/services/backdrop/backdropservice/upload/"
	method="POST"
	enctype="multipart/form-data">
	<input type="file"/>
	<input type="submit" value="test"/>
</form>
</html>

The item iterator always has zero items in it.  I've also tried
executing this "simplest case" code:
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List /* FileItem */ items = upload.parseRequest(request);

The items list is always empty.  I feel like I'm missing something
obvious here.  Anyone have any ideas?

Thanks,
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message