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

Added a custom key function in server side #6

Closed
wants to merge 1 commit into from

Conversation

bensu
Copy link
Contributor

@bensu bensu commented May 25, 2015

Users can now provide a :key-fn to the server handler which given file-name and mime-type will determine the key to use for the S3 file.

Caveat: if the client provides a file my-file.txt and the :key-fn generates a random number as a key (i.e. 12314345), the file location in S3 is given by 12314345, which is what was passed back in the s3-pipe uploaded channel. The file location is no longer sufficient for the client to know which file was successfully uploaded (in case of parallel uploads).

My (non-backwards-compatible) proposal is to put in the uploaded channel all information relevant to the client: both the file object that was uploaded and the response from S3 which contains the :key, :location, :bucket, and :etag.

@martinklepsch
Copy link
Owner

You're on a roll! 👍

If you have an example it'd be great if you could add it to the changelog (just use "unreleased" or something like that as heading.)

Also are there any other changes to the Readme required to be in sync with the new message format for the uploaded chan?

@bensu
Copy link
Contributor Author

bensu commented May 25, 2015

Forgot to document! While adding the changes to the README I produced a conflict. After solving it I can't push it into this branch, so I'm opening a new PR with the non-conflict changes in #7

@bensu bensu closed this May 25, 2015
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

Successfully merging this pull request may close these issues.

2 participants