[GH-ISSUE #298] Add custom metadata to upload #156

Closed
opened 2026-03-04 01:42:41 +03:00 by kerem · 6 comments
Owner

Originally created by @JuanCaicedo on GitHub (Nov 23, 2015).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/298

Not sure if this is something I can't find in the docs, or if it is a feature request.

I'm currently trying to add a this line of metadata to all my files uploaded by s3fs:
Cache-Control: public, max-age=31536000

My guess would be that there can be a config where you set this up, then when s3fs creates a file object, it could do a check for this config an conditionally add another metadata line. However, I'm not sure if this conditional would need to get added to other parts of the code as well.

Originally created by @JuanCaicedo on GitHub (Nov 23, 2015). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/298 Not sure if this is something I can't find in the docs, or if it is a feature request. I'm currently trying to add a this line of metadata to all my files uploaded by s3fs: `Cache-Control: public, max-age=31536000` My guess would be that there can be a config where you set this up, then [when s3fs creates a file object](https://github.com/s3fs-fuse/s3fs-fuse/blob/master/src/s3fs.cpp#L895), it could do a check for this config an conditionally add another metadata line. However, I'm not sure if this conditional would need to get added to other parts of the code as well.
kerem closed this issue 2026-03-04 01:42:41 +03:00
Author
Owner

@CarsonBanov commented on GitHub (Nov 23, 2015):

This would be great to have! +1

<!-- gh-comment-id:159016782 --> @CarsonBanov commented on GitHub (Nov 23, 2015): This would be great to have! +1
Author
Owner

@ggtakec commented on GitHub (Nov 24, 2015):

@JuanCaicedo please try to set ahbe_conf option which is explained simply in man page and there is a sample file ( https://github.com/s3fs-fuse/s3fs-fuse/blob/master/test/sample_ahbe.conf ).
Thanks in advance for your help.

<!-- gh-comment-id:159320233 --> @ggtakec commented on GitHub (Nov 24, 2015): @JuanCaicedo please try to set ahbe_conf option which is explained simply in man page and there is a sample file ( https://github.com/s3fs-fuse/s3fs-fuse/blob/master/test/sample_ahbe.conf ). Thanks in advance for your help.
Author
Owner

@JuanCaicedo commented on GitHub (Nov 25, 2015):

@ggtakec Thanks, I'm giving that a try now and I'll post on here if it works!

One question, in my ahbe_conf file, how should I handle a header (which applies to all files) whose value has a space in it? Should I just write it normally, or maybe wrap it in a string like:

   Cache-Control    "public, max-age=31536000"
<!-- gh-comment-id:159676468 --> @JuanCaicedo commented on GitHub (Nov 25, 2015): @ggtakec Thanks, I'm giving that a try now and I'll post on here if it works! One question, in my ahbe_conf file, how should I handle a header (which applies to all files) whose value has a space in it? Should I just write it normally, or maybe wrap it in a string like: ``` Cache-Control "public, max-age=31536000" ```
Author
Owner

@JuanCaicedo commented on GitHub (Nov 25, 2015):

I was able to get this working just fine following the example, thanks @ggtakec!

Should there be an example of how to do this in the main README so it's easier to find? Or maybe just something saying to check $ man s3fs for more details? If so, I can add that, otherwise I'll close this issue.

<!-- gh-comment-id:159745207 --> @JuanCaicedo commented on GitHub (Nov 25, 2015): I was able to get this working just fine following the example, thanks @ggtakec! Should there be an example of how to do this in the main README so it's easier to find? Or maybe just something saying to check `$ man s3fs` for more details? If so, I can add that, otherwise I'll close this issue.
Author
Owner

@ggtakec commented on GitHub (Nov 26, 2015):

@JuanCaicedo I'm glad about your result by ahbe_conf.
s3fs recognizes the value in line.
The value refers to all until the carriage return after the key(header name). And trailing spaces are removed.
And I make new wiki page for FAQ(https://github.com/s3fs-fuse/s3fs-fuse/wiki/FAQ) which is copied from FAQ in "Fuse Over Amazon" wiki page(https://github.com/s3fs-fuse/s3fs-fuse/wiki/Fuse-Over-Amazon).
It is linked wiki top page(https://github.com/s3fs-fuse/s3fs-fuse/wiki), and I added about custom header(ahbe_conf) on it.

I close this issue, and if you find a problem, please post new issue.
Regards,

<!-- gh-comment-id:159900503 --> @ggtakec commented on GitHub (Nov 26, 2015): @JuanCaicedo I'm glad about your result by ahbe_conf. s3fs recognizes the value in line. The value refers to all until the carriage return after the key(header name). And trailing spaces are removed. And I make new wiki page for FAQ(https://github.com/s3fs-fuse/s3fs-fuse/wiki/FAQ) which is copied from FAQ in "Fuse Over Amazon" wiki page(https://github.com/s3fs-fuse/s3fs-fuse/wiki/Fuse-Over-Amazon). It is linked wiki top page(https://github.com/s3fs-fuse/s3fs-fuse/wiki), and I added about custom header(ahbe_conf) on it. I close this issue, and if you find a problem, please post new issue. Regards,
Author
Owner

@JuanCaicedo commented on GitHub (Nov 27, 2015):

Great, thanks again!

<!-- gh-comment-id:160160736 --> @JuanCaicedo commented on GitHub (Nov 27, 2015): Great, thanks again!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#156
No description provided.