-
1. Re: About upload a 0 size .txt file with ie7 or ie8
nbelaevski Jul 1, 2010 6:39 PM (in response to marsxmu)Hi,
Thank you for reporting the problem! I've created https://jira.jboss.org/browse/RF-8891 for this. The problem seems to be affecting only Flash-enabled mode of rich:fileUpload, so you can try switching it off.
-
2. Re: About upload a 0 size .txt file with ie7 or ie8
marsxmu Jul 1, 2010 10:35 PM (in response to nbelaevski)Thank you for your reply,however I can't turn off the Flash mode since it will object my product request.
-
3. Re: About upload a 0 size .txt file with ie7 or ie8
pyaschenko Jul 2, 2010 5:48 AM (in response to marsxmu)It's a hack but you can try to redefine fileupload js function and insert verification.
something like this:
var backup_flashAdd = FileUpload.prototype._flashAdd; FileUpload.prototype._flashAdd = function (files) {
// delete files from array with size==0
// see original code below
// call original function
backup_flashAdd.call(this, files);
}
or like this (original code + verification + comments):
Object.extend(FileUpload.prototype, { _flashAdd: function(files) { if (this.disabled) return; var filesArray = []; for (var i=this.entries.length; i<files.length;i++) { var file = files[i]; if (file.size!=0) {// file size verification here this.currentInput.value = files[i].name; this.createFrame(); var newEntry = new FileUploadEntry(this.currentInput, this, file.size, file.type, file.creator, file.creationDate, file.modificationDate); this.entries.push(newEntry); filesArray.push(newEntry); if (this.runUpload) { newEntry.setState(FileUploadEntry.READY); } else { newEntry.setState(FileUploadEntry.INITIALIZED); } var newUpload = this.currentInput.cloneNode(true); this.currentInput.style.cssText = "position: absolute; right: 0px; top: 0px; display: none; visibility: hidden;"; newUpload.id = this.id + ":file" + (this.idCounter++); newUpload.value = ''; this.currentInput.parentNode.appendChild(newUpload); this.currentInput = newUpload; } else { // end size verification // put some alert here if needed
} } if (this.events.onadd) { this.element.fire("rich:onadd", { entries : filesArray }); } if (this.runUpload) { this.upload(); } } }); -
4. Re: About upload a 0 size .txt file with ie7 or ie8
marsxmu Jul 7, 2010 9:36 PM (in response to nbelaevski)Hi Nick,
Can you tell me when will the the Rich Faces Jira will be resolve,or an approximate time.
Thanks!
-
5. Re: About upload a 0 size .txt file with ie7 or ie8
nbelaevski Jul 8, 2010 4:09 AM (in response to marsxmu)Currently we are not planning 3.x releases. Please use workaround posted by Pavel.
-
6. Re: About upload a 0 size .txt file with ie7 or ie8
marsxmu Jul 8, 2010 4:57 AM (in response to nbelaevski)Thanks,I will have try!