Hello,
Regarding the zero byte file check - it used to work perfectly fine, however for some reason it just does not work anymore.
- <%
- Dim uploader
- Set uploader=new AspUploader
- uploader.MaxSizeKB=10240
- uploader.Name="myuploader"
- uploader.InsertText="Browse Files"
- uploader.MultipleFilesUpload=false
- uploader.ManualStartUpload=true
- uploader.UploadType="IFrame"
- 'uploader.AllowedFileExtensions="doc,docx,xls,xlsx"
- 'uploader.DialogFilter="Documents (doc/docx/xls/xlsx)|*.doc;*.docx;*.xls;*.xlsx|All files (*.*)|*.*"
- uploader.TempDirectory="testfiles"
- 'uploader.SaveDirectory="files"
-
- %>
Then towards the bottom I have under <Script> tag:
- function CuteWebUI_AjaxUploader_OnSelect(files) {
-
- for (var i = 0; i < files.length; i++) {
- var size = files[i].FileSize
- if (size == 0) {
- alert("" + files[i].FileName + " is a zerobyte file and they are not allowed");
- files[i].Cancel();
- }
- }
- }
Also I am running the uploader as a single file uploader and it runs fine. One issue that I came up with and cannot figure out how to resolve is when I select a file to upload and it shows the file in the QueueList, I have it set to confirm with the user to make sure that they really want to upload the (filename) with a yes and a no button. However, if by chance the user says no or removes the file from the queuelist and choose another file.
The Alert confirmation does not clear itself. If I was to click on Upload without having to select a file afterwards or by selecting another file, it will show me the filename of the file I choose prior and will show me the file name I have selected now with a comma seperating the two or if I removed the file, it will still show me the filename that I choose prior. Please see screenshots below to better understand.
Now the above is doing what it shoulud be. If I was to remove the file by clicking on the X, the alert still shows me the filename when I click on Upload.
For some reason it is not clearing itself when you click remove. Now what happens is if I do this with multiple files it just keeps adding the name of the files to the alert like so:
Is there a way to clear the pop up everytime I change my mind? or remove a file that was selected to upload?
This also happens if I change my mind and browse and select different files in one session, it shows all the files with comma in the alert pop up.
Thanks,
Khan