deleting unavailable file

4 posts, 0 answers
  1. Ömer faruk
    Ömer faruk avatar
    3 posts
    Member since:
    Jun 2012

    Posted 30 Jun 2012 Link to this post

    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

  2. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 04 Jul 2012 Link to this post

    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.
  3. Ömer faruk
    Ömer faruk avatar
    3 posts
    Member since:
    Jun 2012

    Posted 05 Jul 2012 Link to this post

    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 





  4. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 09 Jul 2012 Link to this post

    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.
Back to Top