Open SuperDisk opened 8 years ago
@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.
@JoshSmith I have direct-to-s3 uploads working locally. I'll push it to Arc
soon.
@stavro that's amazing and will be wonderful to see. Happy to help how I can since it's a major pain point here.
@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.
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.
@JoshSmith
Here's an open branch: https://github.com/stavro/arc/pull/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.
@stavro thanks for this! Are you in the Elixir community Slack by chance? I'd tried looking for you there previously but no joy.
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?