adonisjs / attachment-lite

Turn any field on your Lucid models to an attachment data type
MIT License
68 stars 20 forks source link

Is there a way to rename saved files? #10

Closed maukoese closed 2 years ago

maukoese commented 2 years ago

Would be nice to specify names/prefixes for uploaded images.

Something like this

data.avatar = Attachment.fromFile(avatar, {name: new Date().getTime() + '-avatar'} );
thetutlage commented 2 years ago

Yup. Can be supported

maukoese commented 2 years ago

I think that would be very good, to avoid clashes when multiple users upload similarly named files, and the directory structure is not refined.

thetutlage commented 2 years ago

The file is already renamed to random filename. So conflicts are already taken care of.

stale[bot] commented 2 years ago

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.