This is a migrated thread and some comments may be shown as answers.

deleting unavailable file

3 Answers 85 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Ömer faruk
Top achievements
Rank 1
Ömer faruk asked on 30 Jun 2012, 06:47 AM
hi,

In the first use, AllowedFileextensions is unavailable. In the second click select button then is available. I want to when i click select only the allowed extension is available or deleting unavailable selection.And there is another question that I want to put limitation for multiple selection. i do it. But unavailable selection is still seeing. how would i delete them.

best wishes,
ömer

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 04 Jul 2012, 02:05 PM
Hi Ömer,

 
It is not very clear what exactly are you trying to achieve. If you are trying to use file filtering please refer to this help topic because it is not supported in all modules of RadAsyncUpload.
 Would you please explain what do you mean with "unavailable selection is still seeing" in the second issue because it is not very clear as well?

Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ömer faruk
Top achievements
Rank 1
answered on 05 Jul 2012, 09:26 AM
Thanks for your reply. but I solve it. I want to select only 5 image  but when i select 6 or more image i want to delete it. anyway. I have another poroblem now. 

  <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1"
MaxFileInputsCount="5" OnClientFileUploading="fileUploading"
</telerik:RadAsyncUpload>
  function fileUploading(radAsyncUpload, args) {
             var upload = $find("<%= RadAsyncUpload1.ClientID %>");
             var inputs = upload.getUploadedFiles();
             var k = inputs.length;
             if (k > radAsyncUpload._maxFileCount - 1) {
        radAsyncUpload.deleteFileInputAt(k);
             }
         }

for (int i = 0; i < RadAsyncUpload1.UploadedFiles.Count; i++)
        {
            string s = RadAsyncUpload1.UploadedFiles[i].FileName;
            string UploadFolder = "Uploads";
            int w = 400;
            
            string imgName = DateTime.Now.Ticks.ToString() + ".jpeg";
            if (RadAsyncUpload1.MaxFileInputsCount > 0)
            {
                string title = RadAsyncUpload1.UploadedFiles[i].GetFieldValue("TextBox");
                Helper.Resize(s, UploadFolder, w, imgName);
                Helper.Resize(s, UploadFolder, 200, "s" + imgName);
                Helper.delete(s, UploadFolder);
                RadAsyncUpload1.MaxFileInputsCount--;
            }
            Helper.delete(s, UploadFolder);
        }

Helper is my created class. Problem is when deleting file.radAsyncUpload.deleteFileInputAt() if its value k  
  although files was deleted, RadAsyncUpload1.UploadedFiles.Count  return the value of before deleting. and i put k-1 instead of k, this time  RadAsyncUpload1.UploadedFiles.Count  return correct value but MaxFileCount return wrong value. what would i do?

best wishes,
Ömer 





0
Plamen
Telerik team
answered on 09 Jul 2012, 01:52 PM
Hi Ömer,

You can refer to this forum thread where is shown one way implement similar functionality in the OnClientFilesUploaded event.

If you still observe the unusual behavior would you please let us know which event are you using in the code behind and what exactly is the unusual value of MaxFileCount that you are getting.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Ömer faruk
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Ömer faruk
Top achievements
Rank 1
Share this question
or