pqina / filepond

🌊 A flexible and fun JavaScript file upload library
https://pqina.nl/filepond
MIT License
15.06k stars 821 forks source link

[Feature] Modify file object (name) before upload to the server #993

Open nike1v opened 1 month ago

nike1v commented 1 month ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

I'm trying to add timestamp to the filename, but I can't imagine how to make it work with JQuery FilePond. I do need this because I can't modify the file.source after the file uploaded to replace File to a URL of the uploaded file.

Describe the solution you'd like

I'd like to be able to change the name of loading file (or any other property) in the File object OR be able to replace processed file with URL from backend.

Describe alternatives you've considered

I've tried to use oninit, beforeAddFile, onload (in process) to replace file that is being uploaded.

rikschennink commented 1 month ago

https://pqina.nl/filepond/docs/api/plugins/file-rename/ ?

nike1v commented 1 month ago

This makes sense, thanks! Thought that plugin is for users to rename file before upload. My bad!

nike1v commented 1 month ago

But I have to mention, that this worked for the processing file, but when I'm clicking on a file to delete it, I receive in onremovefile old name of the file.

rikschennink commented 1 month ago

I believe the file is renamed before upload.