I have a single page application built with ReactJS and MobX for the front end part, and ruby on rails for the backend part. I have an image drop zone container, and I want the user to be able to upload images, but all the uploading implementation to be done in the front-end part, and the backend only will receive the URL from the uploaded image. Is it possible to accomplish this with ReactJS without involving the server at all?
1 Answers
1
votes
Yes there is a concept called as direct upload which you can use to do this. Here is an article by heroku to do this https://devcenter.heroku.com/articles/direct-to-s3-image-uploads-in-rails
You can also look into the gem carrierwave direct https://github.com/dwilkie/carrierwave_direct
You might also want to check out http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Presigner.html and https://www.npmjs.com/package/react-s3-uploader
If you are willing to use a easy to use managed service filestack.com is a good option.