commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schalk" <sch...@volume4.co.za>
Subject RE: [FileUpload 1.0] Error in compiling to value passed to write()
Date Wed, 23 Jul 2003 16:23:42 GMT
Brian

The servlet now compiles but, what I am wondering is where the file be
written to? How do I tell the write method not only which file to write but
also the location to which it must be written.

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 6:02 PM
:: To: Jakarta Commons Users List
:: Subject: Re: [FileUpload 1.0] Error in compiling to value passed to
write()
:: 
:: 
:: 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
:: 
:: 
:: 
:: 
:: 
:: ---------------------------------------------------------------------
:: 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