I am using EO Web 11.0.66.2
I have an AJAXUploader control that I am using to load multiple files (one at a time), and then will commit to my database after applying some additional information in a two stage operation. My AjaxUploader is within an EO:CallbackPanel, and it a trigger for the panel. This in turn is in a user control hosted in a fairly complex page. Since I can't post this, I recognize that the best I can hope for is a hint of where I might be going wrong.
Ultimately, I believe that the Posted File array in the AJAXUploader is being cleared out, which is making it difficult to display the uploaded but not yet processed files to the user without a postback.
I can set the AJAXUploader to auto-postback and read the files out of the posted file list, but I'd rather show the list of posted files entirely client side.
I am seeing this with IE 11, IE 9 and FireFox.
Code: HTML/ASPX
<eo:AJAXUploader ID="AJAXUploader" runat="server" ClientSideOnError="UploaderOnError" FinalFileList="AJAXPostedFileList" FinalFileLocation="~/UploadTemp" Height="168px" Rows="1" TempFileLocation="~/UploadTemp" Width="400px" SavePostedFileList="False" ClientSideOnChange="uploader_changed">
I have a a Layout Template with a PostedFiles placeholder and -- for testing purposes, a DIV that I am updating with the posted files
Code: JavaScript
function uploader_changed() {
var uploader = eo_GetObject("AJAXUploader");
var postedFiles = uploader.getPostedFiles();
var postedFileHtml;
var postedFileCount = postedFiles.length;
postedFileHtml = "Posted Files: " + postedFileCount;
;
for (i = 0; i < postedFileCount; i++)
{
var postedFile = postedFiles[i];
var fileName = postedFile.getClientFileName();
var fileSize = postedFile.getFileSize();
postedFileHtml = postedFileHtml + "<br/>" + fileName + "[" + fileSize + "]";
}
$("#postedFileList").html(postedFileHtml);
}
When I upload a file, the PostedFiles placeholder and the div are both updated as I'd expect with the file. However, as I upload more files, usually, but not necessarially, at the 4th file, the previously loaded files 'vanish' from the placeholder and my div (and the getPostedFoles().length resets. I have seen this happen immediately on posting a second file, and once after posting about 6 files. However, most frequently, it occurs when posting the 4th. I am using the same files in the same order for my tests.
Since the files are actually in the PostedFileList, when I perform my 2nd stage operation, the files are actually there and the 2nd stage includes all of the files uploaded, including the ones not in getPostedFiles.