commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Cook <bc...@printtime.com>
Subject Re: [FileUpload 1.0] Error in compiling to value passed to write()
Date Wed, 23 Jul 2003 16:01:58 GMT

Example:
                     File fullFile = new File(item.getName());
                     File savedFile = new 
File(getServletContext().getRealPath("/"),fullFile.getName());
                     item.write(savedFile);



Brian

At the top of the code I create:
Public String folder = "folder to which file is to be saved";

The issue for me is after calling item.get() (item being FileItem) how do I
pass this file to the write() method to write it to disk. In the past I
used:
Item.write(folder + currentFile); where currentFile's value is
item.getName();

Kind Regards
Schalk Neethling
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:schalk@volume4.co.za
web: www.volume4.co.za


:: -----Original Message-----
:: From: Brian Cook [mailto:bcook@printtime.com]
:: Sent: Wednesday, July 23, 2003 5:21 PM
:: To: Jakarta Commons Users List
:: Subject: Re: [FileUpload 1.0] Error in compiling to value passed to
write()
::
:: Where is "folder" defined and instantated?  What type of object is it?
::
:: The API shows that it will except objects of type java.io.File only
::
::
:: API for FileItem write method:
::
::   void 	write(java.io.File file)
::            A convenience method to write an uploaded item to disk.
::
::
:: ---------------------------------------------------------------------
:: To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
:: For additional commands, e-mail: commons-user-help@jakarta.apache.org



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





Mime
View raw message