We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

File upload: Delete modified file.

Hi,

I'm using Blazor webassembly with .Net6 (6.0.10) and Syncfusion 20.3.0.56.

When I upload a file with the file uploader, then I modify it on my computer and finally I try to delete it. The deletion failed.

I would still like to be able to delete the file. What can I do? Is it an issue?

I attached an example project.

Best regards,

François


Attachment: Delete_Modified_File_5e3ee39c.zip

5 Replies

UD UdhayaKumar Duraisamy Syncfusion Team November 14, 2022 05:03 AM

We attempted to reproduce the reported issue. Unfortunately, we were unable to replicate the stated problem. A video illustration has been supplied for the same. The file deletion will be done using the uploaded file name. If you modify the uploaded file content( except file name), it will be deleted as per your scenario. If the file name is changed, you will not be able to delete the file.


Video illustration : https://www.syncfusion.com/downloads/support/common/3254/ze/67_5eb591ae.zip




FR François November 15, 2022 05:38 AM

Hi UdhayaKumar,

Thank you for your reply.

I can't access the video you shared. I get an "access denied" message. Can you please grant me access?

I observe this problem with Chrome (v 107.0.5304.107) and Edge but not with Firefox. I didn't have this problem a few weeks ago.

I'm attaching my own video of how I replicate the problem.

Best regards,

François


Attachment: Delete_modified_file_video_90558d09.zip


FR François November 15, 2022 05:46 AM

In the browser console I get the message: 

Failed to load resource: net::ERR_UPLOAD_FILE_CHANGED




UD UdhayaKumar Duraisamy Syncfusion Team November 21, 2022 05:13 AM

In Windows applications, if you open the file and then close it, the file will be maintained in the cache. In your scenario, you are trying to upload and write a file to the same folder. So the uploaded file is maintained in the cache. You can avoid this error by uploading and writing files in different folders. Please refer to the below public blogs for more information.


  1. https://www.maketecheasier.com/solve-file-is-open-in-another-program-error-windows/

  2. https://answers.microsoft.com/en-us/windows/forum/all/file-open-in-another-program/71fac0f4-4f8d-4319-9293-d5f109761cc5



FR François December 5, 2022 10:11 AM

Hi UdhayaKumar and thanks for your answer.

Sorry for my late reply.

The answer you give me implies that the file is cached by Windows. Did I understand it correctly?

I don’t think it is a problem with Windows because I don’t get the “file is open in another program” error and because it works with Firefox. I think it may be a security feature from chromium. What do you think?


When this error happens, instead of blocking the deletion, could the SfUploader send the name of the file to delete to the controller ? Like the case where the file is preloaded (see https://www.syncfusion.com/forums/178876/file-upload-remove-a-preloaded-file).


Best regards,

François


Loader.
Live Chat Icon For mobile
Up arrow icon