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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the modified uploaded file name in server side while delete a file?

Platform: ASP.NET MVC |
Control: Uploadbox |
Published Date: February 8, 2018 |
Last Revised Date: February 8, 2018

How to modify uploaded file name and delete the modified file in Uploadbox?


In the UploadBox save process, let us assume that a file is uploaded to server and after some modifications, save the file with another name in the server. Now when that file is required to be deleted from the server using the UploadBox, it cannot be done using the old name. So, the modified name from the server is required during the file delete process. 


To get started with this example, refer to the Getting Started section in the Uploadbox’s UG documentation and create a basic UploadBox example.

In the Save handler, the uploaded file name is altered and saved in a location in the server.  Now that is done, the updated name along with original name is returned to the UploadBox as a JSON. Refer to the following code.


The client-side “Success” event will be triggered when each upload action is successful. In that event, the JSON returned from the server with the modified file name can be accessed and added as a new attribute to the span element of the corresponding li element. Refer to the following code: 


After the new name is added to the uploadbox as an attribute, some changes in the UploadBox’s internal _xhrOnRemove method are required to access the new name instead of the old value. Refer to the following code.



You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon