-
Notifications
You must be signed in to change notification settings - Fork 440
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
Set content type based on file extension #155
Comments
Hi There, Any help is greatly appreciated. |
gcsfuse doesn't manage GCS metadata for the user (and in general this is impossible or requires error-prone sniffing). If you care about setting these properties, you'll need to set them yourself using the GCS storage browser or the GCS API. |
Hi @jacobsa searching the web i found that similar tool (like s3fs-fuse) support the mapping of the content-type by means of the mapping file. Thank you. |
As I said above, you can do this with content sniffing but it's error prone and I think it's not a good decision engineering-wise. Could you say a bit more about why you need this? Again, you can easily set this value using the GCS API. |
But we can skip content sniffing observing only the file extension, i know that it's error prone but i don't see other ways. I'm using gcsfuse to map uploads directory of Wordpress to share directory between multiple instances. I have to upload images, directories, text, doc etc. |
+1 |
so, @jacobsa do you have any plan to add this feature? Thank you. |
Can you explain why it's important that you have a content type set in GCS? If you're using GCS as a file system it's meaningless, so I assume it's interoperability with some other use. Can you also explain why using the GCS API to set it doesn't work well for you? |
I'm using gcsfuse to sharing a directory between multiple instance of our Wordpress portal, then it's Wordpress that put files on gcs using gcsfuse and i can't edit content-type via API. |
Thanks, but how about the first question: why is it important that content type be set in the first place? |
Because the files will be missinterpreted by web browers. A link URL to an image with content-type octetstream can by downloaded and did not view by a browser. |
Okay. I see how pragmatically it's a good idea to set a default based on extension. If gcsfuse gets it wrong the user is no worse off than now -- they must go and use the API to fix it. Thanks for your patience. |
Implementation note: will want to use |
thank you @jacobsa How long do you think it takes to implement it? |
I'll try to get to it soon. |
Hi all, please try gcsfuse 0.17.0 and let me know how it works for you. |
It works perfectly, i'll continue to test it. Thank you ;-) |
Hi,
i'm trying to copy png and jpeg on a bucket, but it set always the content-type to octetstream instead of image/png or image/jpeg.
Thank you.
The text was updated successfully, but these errors were encountered: