How To Get All Image File Name Before Start Upload?
I want to get the name of image using foreach or each in plupload. I have old code here but is not working var uploader = $('#uploader').plupload('getUploader'); i
Solution 1:
You may try this (I guess you don't really need the if clause in this context)
var uploader = $('#uploader').plupload('getUploader');
if (uploader.files.length > 0)
{
for(var i=0; i<uploader.files.length; i++)
{
alert(uploader.files[i].name);
};
}
or this, which won't work on older browsers. (IE8 and older)
var uploader = $('#uploader').plupload('getUploader');
if (uploader.files.length > 0)
{
uploader.files.forEach(function (file) {
alert(file.name);
});
}
Post a Comment for "How To Get All Image File Name Before Start Upload?"