commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jantek Bal√°zs <bjan...@ratesoft.hu>
Subject commons.fileupload: only memory usage
Date Mon, 22 Jun 2009 14:30:46 GMT
Hi!

I would like to ask if it is possible to configure
a fileItemFactory so that it never uses the file system.

I would need a kind of MemoryFileItemFactory.. :-)

My problem is that my webapp has no access to the file system.
If i set a large threshold on a DefaultFileItemFactory of
a DiskFileItemFactory, i always get permission exceptions.

I would like to separate the uploaded small (xml) files so
that my servlet doesn't hit the file system.

Do you have any ideas?

Thanks!

jb

**********

DiskFileItemFactory factory = new DiskFileItemFactory();

			// Set factory constraints
			factory.setSizeThreshold(1024 * 1024);
			factory.setRepository(new File("tempfile.tmp"));

			// Create a new file upload handler
			ServletFileUpload upload = new
ServletFileUpload(factory);
			
			try {
				List items = upload.parseRequest(request);
				// PERMISSION EXCEPTION HERE


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


Mime
View raw message