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

    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" "">
    <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 :(
    <head runat="server">
    <form id="form1" runat="server">
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
      <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
            onfileuploaded="RadAsyncUpload1_FileUploaded" TargetFolder="images/_test">
    <asp:Button ID="Button1" runat="server" Text="Button" /> 
  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
    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.

    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