The file is already written to the temporary location by the time you have a FileItem, so it is too late to change it there. You need to specify the path to FileUpload class, either with the setter or in the parseRequest method. As it appears you are using this integrated into ParameterParser, you would set it in TurbineResources.properties
# # The directory where files will be temporarily stored. # services.UploadService.repository=/tmp Note that the directory must exist. The service first checks that the directory exists in the webapp directory, if not it assumes the path was absolute. john mcnally Bruce Altner wrote: > > Greetings: > > My application uses FileItem in a class which uploads a file from the > user's local drive to a remote server. It has always worked without a hitch > but recently was deployed on a box where the default storeLocation is > write-protected, so it fails. I am interested in being able to specify the > location where the tmp file is written to avoid this problem but > storeLocation is a protected field in FileItem and there is no accessor > method (that I could find). Do I have to write my own version of FileItem > or is there a way to set this using this class. > > Here is how I am using FileItem: > > FileItem fi = data.getParameters().getFileItem( "filename" ); > InputStream ins = fi.getInputStream(); > String fqFilename = fi.getFileName(); > > etc. > > Thanks, > Bruce > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
