This content has been marked as final.
Show 4 replies
-
1. Re: fileUpload control doesn't handle fileName?
fridgebuzz Feb 3, 2009 7:57 PM (in response to fridgebuzz)I should add that I've tested it on both Safari and Firefox. But not IE. Also, for the sake of completeness, here's an excerpt of the code for the uploadService:
@Name("uploadService") @Scope(ScopeType.EVENT) @AutoCreate public class Uploader { private byte[] data; private String contentType; private String fileName; public boolean save() { // do stuff with data and contentType if (fileName == null) log.debug("OH NO, fileUpload control not working"); // ... etc. it's a very long method } public byte[] getData() { return data; } public void setData(byte[] data) { this.data = data; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } }
Furthermore, the data and contentType seem to come through fine.
Cheers,
Vanessa
-
2. Re: fileUpload control doesn't handle fileName?
fridgebuzz Feb 4, 2009 1:05 AM (in response to fridgebuzz)Oh rats... it's a typo. I wish it would have given me a syntax error. sigh. Sorry for wasting anyone's time...
"#uploadService.fileName"
should be
"#{uploadService.fileName}", obviously.
-
3. Re: fileUpload control doesn't handle fileName?
binnyg Feb 4, 2009 1:58 AM (in response to fridgebuzz)I have used this component before and it behaves differently in IE. IE sends the full path of the file where as other browsers sends just the filename. FYI.
-
4. Re: fileUpload control doesn't handle fileName?
fridgebuzz Feb 4, 2009 2:37 PM (in response to fridgebuzz)Thanks for the heads up, Binesh. I'll test it on IE to be certain. I saw in the resolved issues that this is fixed in a recent version, but I can't remember exactly which.
Cheers,
Vanessa