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.
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.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|