struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Session A Mwamufiya" <smwam...@andrew.cmu.edu>
Subject RE: file upload exception
Date Sat, 15 Sep 2007 21:07:00 GMT
Yes the file is the right size; I tried it with different files to upload, and the size seems
correct.


> Please look at the code from FileUploadInterceptor that I posted.
> Answering my question ("Is it the correct size?") is a good adjunct to the
> snippet as well.
> 
> --- Session Mwamufiya <smwamufi@andrew.cmu.edu> wrote:
> 
>> Hi Dave,
>> 
>> I don't copy the file at all.  The FileUploadInterceptor gets called
>> before I can do anything with the file.
>> 
>> Session A. Mwamufiya Carnegie Mellon University MBA | Tepper School of
>> Business MSE (software eng.) | School of Computer Science T: (412)
>> 508-5455 | semwamufiya@cmu.edu
>> 
>> -----Original Message----- From: Dave Newton
>> [mailto:newton.dave@yahoo.com] Sent: Friday, September 14, 2007 7:21 PM 
>> To: Struts Users Mailing List Subject: Re: file upload exception
>> 
>> --- Session A Mwamufiya wrote:
>>> I check whether the uploaded file exists (also
>> it's
>>> name and size) in my getters and setters.
>> 
>> Is it the *correct* size?
>> 
>> Have you looked at the FileUploadInterceptor code to see how it behaves
>> or looked at the log file to see what information it might provide? The
>> following is from 2.0.8, and provides a hint as to why I was asking about
>> the file being copied etc.
>> 
>> // invoke action String result = invocation.invoke();
>> 
>> // cleanup fileParameterNames = multiWrapper.getFileParameterNames(); 
>> while (fileParameterNames != null && 
>> fileParameterNames.hasMoreElements()) { String inputValue = (String) 
>> fileParameterNames.nextElement(); File[] file =
>> multiWrapper.getFiles(inputValue); for (int index = 0; index <
>> file.length; index++) { File currentFile = file[index];
>> 
>> 
> log.info(getTextMessage("struts.messages.removing.file",
>> 
>> new Object[] {inputValue, currentFile},
>> 
>> ActionContext.getContext().getLocale())); if ((currentFile != null) && 
>> currentFile.isFile()) { currentFile.delete(); } } }
>> 
>> d.
>> 
>> 
>> 
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
>> commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
>> 
>> 
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
>> commands, e-mail: user-help@struts.apache.org
>> 
>> 
> 
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
> commands, e-mail: user-help@struts.apache.org
> 
> 
> 


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


Mime
View raw message