Cancel button does not delete the uploaded file after upload is finished

2 posts, 0 answers
  1. Konstantinos
    Konstantinos avatar
    10 posts
    Member since:
    Sep 2011

    Posted 27 Sep 2011 Link to this post

    Dear Sir/Madam

    I am trying out a trial version of your RadControls for Silverlight4 product (2011_2_0712 & 2011_2_0920) on IIS 6 ASP.NET 3.5, using VS2010 and Blend4.


    If I hit the cancel button while a file is being uploaded, the upload stops and the partial file is deleted from the disk. If I hit the cancel button after a file has been uploaded, the file is removed from the interface but it is not deleted from the disk.


    Is there a way I can make the cancel button delete the file even after the upload is finished?


    To be more specific, I have a CancelButton which is initially hidden:

     

    <StackPanel HorizontalAlignment="Right" Margin="3" Orientation="Horizontal" VerticalAlignment="Center">

    <telerik:RadButton x:Name="CancelButton" Content="Cancel" Command="{TemplateBinding CancelCommand}" Margin="5" Padding="15 3" telerik:LocalizationManager.ResourceKey="UploadCancel" telerik:StyleManager.Theme="{StaticResource Theme}" Visibility="Collapsed"/>

     

    When the file is uploaded, it is visible:

     

    <VisualState x:Name="Uploaded">

    <Storyboard>

    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CancelButton">

    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>

    Using your example file in [1], I saw that the Cancel event is not called when the visible cancel button is pressed after the upload has finished.

    I have already read in [2] that you suggest to: "...modify the default style of the RadUpload and either bind the Command of the Cancel button to a custom one or handle its Click event so that you know when this button has been cancelled. Then you can add your custom code and call Upload.CancelUpload() method."

    I have also read in [3] though, that this is supposed to be a resolved issue and that it should not be happening. So, is this behavior expected/programmed or is it a bug?

    Waiting for your response. Thank you.

    [1] http://www.telerik.com/ClientsFiles/150070_203565-example-20090924-1522.zip
    [2] http://www.telerik.com/community/forums/silverlight/upload/how-to-handle-the-upload-cancel-event.aspx
    [3] http://www.telerik.com/support/pits.aspx#/public/silverlight/2434

  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 30 Sep 2011 Link to this post

    Hi Konstantinos,

    The Cancel button is used to cancel the current upload session. After the file has been uploaded, the session is complete and the cancel button just resets the session.

    Currently, we have nothing exposed on the Silverlight Upload control to delete a file. This would have to be done manually on the server.

    All the best,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top