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

IsValid in FileUploaded server-side event does not work

2 Answers 115 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Eugeny
Top achievements
Rank 1
Eugeny asked on 18 Sep 2010, 08:45 PM
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 Answers, 1 is accepted

Sort by
0
Eugeny
Top achievements
Rank 1
answered on 21 Sep 2010, 06:44 AM
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.
0
Genady Sergeev
Telerik team
answered on 22 Sep 2010, 04:05 PM
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
Tags
AsyncUpload
Asked by
Eugeny
Top achievements
Rank 1
Answers by
Eugeny
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or