-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to auto rename the file name of uploaded file or image? #857
Comments
reasons
|
I think guys need this feature.Because many guys do not want to change local file name before upload. |
This shouldn't happen by default, but should be possible through config, agreed. |
I would like to add a 4th to the list. Recently I had an issue with a non-technical person uploading an image that had special characters (in my case the # sign) causing the static site to have an error during its' build. So:
I think the fix for all these may need to be separate features though. 2-4 seem to work well with an automatic approach, but overwrites (no. 1) should probably have an option similar to delete in the media manager. Could be called reupload, but that might be too close to "upload" and be confusing to some. You shouldn't be able to replace an image file just by uploading another of the same name as this could cause loss of data problems. So it should either follow a delete file -> upload new file pattern or have a special upload mode specifically for replacing. |
@tech4him1 doesn't your slug sanitization work provide a solution for this? |
Sanitizing media filenames is part of #1135. |
Also @DomtronVox, uploading an image of the same name as an existing image currently triggers a prompt, it won't just overwrite. |
It would be good if panel prompted the name before commit. As the config option. |
@erquhart Can we agree on the options ? Suggestions:
Same tags available as https://www.netlifycms.org/docs/configuration-options/#slug
|
Templated default filenames makes sense, as well as prefixing and only allowing the user to add/edit a portion of the resulting filename (maybe). That's separate from the core issue of making the filename editable though. We should split this issue into two concerns:
Editable filenames is mostly a UI problem. The more complex issue of creating and enforcing slugs is larger than the problem at hand (#445). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am not familiar with the codebase. Where should I look to allow renaming a file prior to upload in the UI? |
Hi Is this still something people want? I certainly would love to be able to rename my files/images before uploading them. If a maintainer could point me in the direction of the code for handling file uploads I would be happy to send a PR Thanks |
Hi @Soneji, maybe we can do this as a part of #4965? The UI code for the media library is here https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-core/src/components/MediaLibrary |
👍 For another angle: I have clients that use an iPad to update content. It's awesome that they can select a photo from the iPhoto library on the device, however, iPhoto appears to export the image with a GUID file name. Being able to customize the file name at the time the file is uploaded would solve this issue. I mean, this is clearly iPhoto's fault... but since there's already a ticket open... 😄 |
How to auto rename the file name of uploaded file or image?
I mean when i upload an image or file, how to auto rename it?like slug, or use timestamp to file name
The text was updated successfully, but these errors were encountered: