Hello, I would like to know if there was any possibility to DELETE an asset after a predefined time and if it is possible to change path of an asset (I know it is possible to change its id with rename method but that method does not help me here).
I am coding an app with a form page where users can add medias and text informations.
The idea is to start the upload as soon as the user added any media from the form to divide upload operations and start create a desired data structure for each media, which will be used in the final submit. The goal is to prevent many assets from uploading at the submit time, to provide a better user experience.
The flow would be: user add media in form => in background POST request to a personal API which send media to upload to Cloudinary / at the same time user can go on filling form => when upload complete in background, Cloudinary sends to my API a temporary link to the uploaded asset and my API sends it to the client in an object representing the asset.
The difficulty is if the user never submits form (because he closes the window for example), there will be asset(s) uploaded on Cloudinary which will be never used. I need to find a way to delete the asset and if the user submitted the form, to overwrite the temporary link of each asset.
I have the idea to overwrite the path of each temporary link at the submit, in case of submission, so that the assets remain on Cloudinary and the programed/parametized delete process with temporary link fails (because path would have change) and my API catch and handle error.
I would like to know if you think the flow that I am considering is the good one, and if you have any idea how to do the delete part and temporary link with Cloudinary tools. Thank you for your help!
Please sign in to leave a comment.