IsValid in FileUploaded server-side event does not work

3 posts, 0 answers
  1. Eugeny
    Eugeny avatar
    23 posts
    Member since:
    Nov 2009

    Posted 18 Sep 2010 Link to this post

    Hello
    I use e. IsValid = false; in FileUploaded server-side event. But it does not work.
    The uploaded image is saving in TargetFolder. Here is my code:

    <%@ Page Language="C#" AutoEventWireup="true" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <script runat="server">
      protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
      {
        // here is code for creating and saving thumbnail
        //    ...
     
        e.IsValid = false;    // now we want to discard uploaded image.
                             // But this does not work :(
      
    </script>
     
    <head runat="server">
        <title></title>
    </head>
    <body>
     
    <form id="form1" runat="server">
     
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
      </telerik:RadScriptManager>
     
      <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
            onfileuploaded="RadAsyncUpload1_FileUploaded" TargetFolder="images/_test">
      </telerik:RadAsyncUpload
    <asp:Button ID="Button1" runat="server" Text="Button" /> 
     
    </form>
    </body>
    </html>
  2. Eugeny
    Eugeny avatar
    23 posts
    Member since:
    Nov 2009

    Posted 21 Sep 2010 Link to this post

    I set e.IsValid = false; in ValidatingFile server-site event handler.
    Now after execution of the FileUploaded server-side event handler the uploaded file is automatically discarded.
  3. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 22 Sep 2010 Link to this post

    Hello Ivan Petrov,

    Thank you for pointing the issue to us. This is clearly a bug in RadAsyncUpload. We will do a major revision of the validation functionality for the upcoming Q3 release and issues like this are going to be resolved. Actually, the fix is going to be available forth from service pack 2 which is scheduler for the end of the month. I've also added added 700 telerik points to your account for reporting the problem.

    Regards,
    Genady Sergeev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top