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

Using Amazon S3 #1

Closed
oleteacher opened this issue Aug 23, 2017 · 3 comments
Closed

Using Amazon S3 #1

oleteacher opened this issue Aug 23, 2017 · 3 comments

Comments

@oleteacher
Copy link

Really like the simplicity of your smart uploader, great job.

I am confused on how to setup amazon s3 within the js files. Looking at examples is not helping me to understand. Did not see anything on wiki?

Could you explain where I would enter my Amazon S3 info?

Thank you.

@sagidM
Copy link
Owner

sagidM commented Aug 25, 2017

@oleteacher,
Thank you question.

I just make post request to Amazon S3.
So, you need to allow files:
Choose your bucket, click to "Permissions" tab, in "Public access" you have what you need.

This photo may help
2017-08-25 09-41-14

You can use this simple form to upload any file

  <form action="http://[YOUR_BUCKET_NAME].s3.amazonaws.com" method="post" enctype="multipart/form-data">
  	<input type="text" name="key" value="my file's name here">
  	<input type="file" name="file">
  	<input type="submit" >
  </form>

Hope it helped


UPD
As far as I know, Amazon allow upload only one file in one request.
And key always must be before file


UPD

I almost forgot.
It's unsecure method because every person can upload their files and replace yours!
So you should pre-sign your request with special key. This key is created on server side (it also contains path to file).

Once, this link helped me
https://devcenter.heroku.com/articles/direct-to-s3-image-uploads-in-rails#pre-signed-post
Even if you don't use Heroku or Ruby on Rails, reading this article should help.

For other languages you can use search on Heroku.
And also see the official docs
http://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html

@sagidM sagidM closed this as completed Aug 25, 2017
@sagidM sagidM reopened this Aug 25, 2017
@oleteacher
Copy link
Author

Thank you much for reply and input @kofon95

I was under impression that your script was setup to use amazon key & secret. I will explore to see if can use as is.

Thank you again.

@sagidM
Copy link
Owner

sagidM commented Aug 26, 2017

You're very welcome

@sagidM sagidM closed this as completed Aug 26, 2017
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

2 participants