Skip to content
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

Add metadata support #5

Open
kevinschaul opened this issue Jan 27, 2015 · 2 comments
Open

Add metadata support #5

kevinschaul opened this issue Jan 27, 2015 · 2 comments

Comments

@kevinschaul
Copy link
Contributor

It could be useful to have an option allowing files to have metadata associated with them on upload. I'm running into a situation where we'd like to attach different http cache-control headers to files, based on their file extensions.

I imagine the API could involve passing a metadata dict, mapping filename matching regex patterns to a list of key-value tuples defining the metadata.

Any thoughts before I attempt this?

@shakefu
Copy link
Owner

shakefu commented Jan 27, 2015

Assuming you're referring to this metadata, I think passing a dict into the programmatic API works fine.

If you want to implement a command line --option for it as well, I'd suggest using a dict-friendly file format like JSON or YAML as the argument, which would then be passed through to the API.

If you'd like more complex behaviors, I think adding the ability to register before and after hooks, which would be able to modify the Key (and probably also be passed the original filename), would be a solid approach.

@kevinschaul
Copy link
Contributor Author

That is the metadata I was referring to.

Yes, I agree. I should be able to send a pull request with a rough implementation in the next few days. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants