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

Fixing Emoji.UploadLeaseImage, adding missing async methods #86

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MingweiSamuel
Copy link
Contributor

@MingweiSamuel MingweiSamuel commented Sep 8, 2019

If you're curious what was wrong, it turned out that the "content-type" parameter is needed, so this line got removed:

if (!s3Field.Name.Equals("content-type", StringComparison.OrdinalIgnoreCase))

And also I think AddFileBytes might have been an issue, switched to AddFile, not sure specifically what the difference is.

@MingweiSamuel
Copy link
Contributor Author

Example of how to use it: https://github.com/ChampionMains/Pyrobot/blob/5a89751bb1eebedbf61f9a9c9ff526f2feae9356/ChampionMains.Pyrobot.Infrastructure/Services/Reddit/EmojiService.cs#L38-L40

I wanted to support sync vs async, and also byte[] vs inputstream, so the actual implementation has a few layers. I also ended up taking ImageUploadInput as input, which is convenient, but it would also be possible to take the mime type from the s3 lease like the old code does. Would still need to provide file name separately though

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