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

JSON Resource uploading #50

Open
SuperDisk opened this issue Oct 26, 2016 · 7 comments
Open

JSON Resource uploading #50

SuperDisk opened this issue Oct 26, 2016 · 7 comments

Comments

@SuperDisk
Copy link

The example in the README.md walks you through uploading a file using a HTML <form>. How do you post a file and other attributes to a JSON api?

@joshsmith
Copy link

@SuperDisk I handle this in https://github.com/code-corps/code-corps-api by uploading files as base 64 strings.

I'm not super satisfied with this since I'm on Heroku and large files result in time outs. I'd prefer if I could upload to S3 directly and have arc_ecto (somehow!?) be used for reference.

@stavro
Copy link
Owner

stavro commented Nov 3, 2016

@joshsmith I have direct-to-s3 uploads working locally. I'll push it to Arc soon.

@joshsmith
Copy link

@stavro that's amazing and will be wonderful to see. Happy to help how I can since it's a major pain point here.

@stavro
Copy link
Owner

stavro commented Nov 3, 2016

@SuperDisk I highly recommend sticking to multipart file uploads rather than JSON. This is trivial with Angular and most other frontend clients. Uploading files via JSON is using the wrong tool for the job IMO.

@joshsmith
Copy link

I will also say that even though our implementation works, I really dislike it. It feels ham-fisted, as @stavro said – wrong tool for the job.

@stavro
Copy link
Owner

stavro commented Nov 3, 2016

@joshsmith

Here's an open branch: stavro/arc#125
Here's some documentation: https://github.com/stavro/arc/wiki/Direct-to-S3-Uploads

Feel free to start playing with it, though I have a lot more to document. Especially surrounding content disposition.

@joshsmith
Copy link

@stavro thanks for this! Are you in the Elixir community Slack by chance? I'd tried looking for you there previously but no joy.

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

3 participants