Hi there
I am using the file uploader and have javascript to handle 2 types of errors:
1. File is too big
2. The user is uploading something with the wrong file extension.
Now I've wired it up just fine, as it errors in both cases.
Code: HTML/ASPX
<EWe:AJAXUploader ID="uploader"
runat="server"
MaxDataSize="1000"
TempFileLocation="~/_tempdocs"
MaxFileCount="1" ClientSideOnError="UploadError"></EWe:AJAXUploader>
Code: JavaScript
function UploadError() {
var uploader = eo_GetObject('uploader');
var filename = uploader.getCurrentFileName();
var fileExtensions = uploader.getAllowedExtension();
}
My questions is this: When I run the upload, I try to get back the current file name they've input and yet the javascript returns "Undefined". Am I misunderstanding the purpose of this method? Can I not get the name of the file at this stage?
The reason for this is simply to determine which type of error I have encountered. Did they attempt to upload a file thats too big or did they upload one which had the wrong file extension?