nrempel / adonis-storage

Storage provider for AdonisJS
MIT License
21 stars 6 forks source link

Set upload file properties #7

Open ankitchauhan477 opened 7 years ago

ankitchauhan477 commented 7 years ago

ACL - public read contentType - image/jpg

because if we don't set contentType ... S3 take it as application binary octet ... so is there any way to pass contentType while uploading files. As well as public read for uploaded files.

mikehhhhhhh commented 6 years ago

I added a PR that enables just this as well as fixes some issues with newer S3 AZs quite a long time ago, @nrempel doesn't seem to have got around to merging or, or perhaps he's decided not to at all.

Feel free to checkout https://github.com/mikehhhhhhh/adonis-storage

There's an extra arg for put methods that takes an object passed directly to the S3 request, so you can do something like this;

yield Storage.putFile('/path/to/file', contents, {ContentType: 'image/jpeg'})