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

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

1 Answer 162 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Konstantinos
Top achievements
Rank 1
Konstantinos asked on 27 Sep 2011, 04:42 PM

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

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 30 Sep 2011, 12:33 PM
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 >>

Tags
Upload
Asked by
Konstantinos
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or