Skip to content

Commit

Permalink
Introduce new optional file_dom_el param
Browse files Browse the repository at this point in the history
For passing in the file input directly, rather than with a selector.
  • Loading branch information
nikolas committed Sep 21, 2023
1 parent f6c36f6 commit c38ef59
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
==================
* Adjust S3Upload.file_dom_selector to allow for any DOM selector
rather than just an ID.
* Introduced new optional param `file_dom_el` for passing in the file
input element directly. This is convenient when initializing
S3Upload from an event, as you can just pass in the event.target
object.

0.3.3 (2023-03-03)
==================
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ And
<script>
function s3_upload() {
var s3upload = new S3Upload({
file_dom_el: null, // Optional, and overrides file_dom_selector
// when present.
file_dom_selector: '#file',
s3_sign_put_url: '/sign_s3/', // change this if you route differently
s3_object_name: $('#file')[0].value,
Expand Down
6 changes: 5 additions & 1 deletion s3sign/static/s3sign/js/s3upload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c38ef59

Please sign in to comment.