
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
This gem offers a helper method to build a form HTML to upload directry to Amazon S3 storage by using POST method. With this gem, you can easily exclude settings for aws s3 direct upload and generate upload form by calling a single helper method.
Add this line to your application's Gemfile:
gem 'aws_upload'
And then execute:
$ bundle
Or install it yourself as:
$ gem install aws_upload
Make your initialization script to configure uploading parameters.
in config/initializers/aws_uplaod.rb
AwsUpload.configure do |config|
config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
config.aws_region = ENV['AWS_REGION']
config.uploader :image do |u|
u.bucket = 'bucket-name'
u.key_prefix = 'some-prefix/'
u.options[:acl] = "public-read"
u.options[:content_length_range] = 0..1024
u.options[:success_action_redirect] = "http://url.to/redirected/pass"
end
end
Call aws_upload_form method from view erb file.
Generate a form to upload a file with the name of "uploaded_file.jpg"
<%= aws_upload_form(:image, "uploaded_file.jpg") %>
Generate a form to upload a file with the uploaded file name
<%= aws_upload_form(:image, "${filename}") %>
You can specify options. It will override the options specified in the configuration.
<%= aws_upload_form(:image, "uploaded_file.jpg", acl: "private", metadata: {original-filename: '${filename'}) %>
You can customize file and submit input by giving a block.
<%= aws_upload_form(:image, "uploaded_file.jpg") do %>
<input type="file" name="file">
<input type="submit" value="Upload">
<% end %>
You can find further options in AWS::S3::PresignedPost document, which is internaly used in this gem. http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/PresignedPost.html#initialize-instance_method
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that aws_upload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.