|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi,
I am using the AJAX uploader, and have a requirement to be able to exclude certain file extensions from being uploaded. I realise that we don't have an ExcludedExtensions property, but is there any way of achieving this using javascript?
I thought about handling the onStart event. I could inspect the current file using getCurrentFileName, and then call cancel if the extension is excluded. The problem is that calls to getCurrentFileName always seem to come back with 'undefined'. Any ideas?
Regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You will only see the current file name once the upload is in progress. So you have to let the uploading to start first. Once it is started, you can handle the uploader's ClientSideOnProgress event and if you see the wrong extension, you can cancel the upload. This is not a perfectly clean solution but that is the closest you can get.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Thanks, I will give that a try.
|
|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi,
I can't seem to get this to work. getCurrentFileName seems to return null until the file has uploaded.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That would be interesting. We will look into it and get back to you.
Thanks!
|
|