If you are looking for a simple solution to download multiple files from the AWS S3 Web Console look no further. The S3 Downloader Bookmarklet is the solution!
In some situations we need a quick and easy way to download files from S3 without the need to setup or use a separate application such as Cloudberry Explorer, S3 Browser, UI Bakery, Yarkon S3, or installing Filestash. This is the perfect solution when you need to download 5, 10, 50 or even 100 files quickly without having to install a separate application.
Using the S3 Downloader Bookmarklet
The S3 Downloader Bookmarklet is a simple bookmark you can add to your browsers bookmarks to automate the process of downloading multiple files from Amazon S3 in your web browser. The S3 Downloader Bookmarklet does this by using JavaScript to repeatedly check the box on a specified row then invoke the "Download" button. When clicking the S3 Downloader bookmark you will first confirm to continue, then you will be prompted for the delay in seconds between downloads and the row numbers to download:
Click the S3 Downloader bookmark - This will invoke the installed bookmarklet.
Confirmation - Confirm that none of the checkboxes are checked before you continue. This box also has other information to remind you of the limitations of this Bookmarklet.
Seconds between downloads - Enter a number of seconds between downloads to spread the download requests apart. The default value is 1 second. Depending on your Internet connection speed and the size of the files you may wish to use a larger delay to spread out the download requests.
Start row number / start-end range - Enter a start row number or start-end row number to specify a range of rows. The first row starts with 1. If no end value is specified the first 50 rows are downloaded. For example "1" to download rows 1 through 50. Enter "21-60" to download rows 21 through 60.
Once you click "OK", do not navigate away until all of the files are downloaded.
Files downloaded will appear in the "files "Downloads" view in your web browser.
Browser specific settings
Multiple files warning - If you use a small delay such as 1 second, your browser may prompt you with a download multiple files warning. Click "Allow" to continue.
As each file is downloaded, you may be prompted to select where each download should be saved. You can turn this off by going into your browsers settings and turning off the option to select where to save each file before downloading.
Installing the S3 Downloader Bookmarklet
The S3 Downloader Bookmarklet can be installed by creating a bookmark in your web browser's bookmarks and pasting the bookmarklet code below into the URL field.
javascript:(function()%7Bjavascript%3A%20(()%20%3D%3E%20%7B%0A%0Afunction%20downloadS3(rowStart%2CrowEnd%2CdelaySeconds%3D1)%7B%0A%20%20console.log(%22Downloading%20files...%20Row%20Start%3A%20%22%2B%20rowStart%20%2B%22%3B%20Row%20End%3A%20%22%2B%20rowEnd%20%2B%22%3B%20Seconds%20between%20downloads%3A%20%22%2BdelaySeconds)%3B%0A%20%20const%20checkboxes%20%3D%20document.querySelectorAll('div%5Bclass%3D%22s3-objects-view-container%22%5D%20div%5Bclass%5E%3D%22awsui_content_%22%5D%20input%5Btype%3D%22checkbox%22%5D')%3B%0A%20%20if(%20checkboxes%20)%20%7B%0A%20%20%20%20var%20rowNum%20%3D%200%3B%0A%20%20%20%20var%20dlCount%20%3D%200%3B%0A%20%20%20%20checkboxes.forEach(checkbox%20%3D%3E%20%7B%0A%20%20%20%20%20%20if(%20rowNum%20%3E%200%20%26%26%20rowNum%20%3E%3D%20rowStart%20%26%26%20rowNum%20%3C%3D%20rowEnd)%20%7B%0A%20%20%20%20%20%20%20%20const%20thisRow%20%3D%20rowNum%3B%0A%20%20%20%20%20%20%20%20setTimeout(()%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20%20%20console.log(%20'Row%3A%20'%2BthisRow%20%2B%20%22%3B%20id%3A%20%22%2Bcheckbox.id%20)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20Elem%20%3D%20document.getElementById(%20checkbox.id%20)%3B%0A%20%20%20%20%20%20%20%20%20%20if(%20Elem%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20Elem.click()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById('download-object-button').click()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20Elem.click()%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%2C%20dlCount%20*%201000%20*%20delaySeconds%20)%3B%0A%20%20%20%20%20%20%20%20dlCount%2B%2B%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20rowNum%2B%2B%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D%0A%7D%0A%0Alet%20confirmRes%20%3D%20confirm(%22BEFORE%20PROCEEDING%2C%20MAKE%20SURE%20NONE%20OF%20THE%20ROWS%20ARE%20CHECKED.%5Cn%5CnNOTE%3A%20Folders%20will%20not%20be%20downloaded.%5Cn%5CnTIP%3A%20Setup%20your%20browser%20to%20automatically%20download%20files.%5Cn%5CnDO%20NOT%20NAVIGATE%20AWAY%20FROM%20THIS%20PAGE%20UNTIL%20DOWNLOADS%20FINISHED.%22)%3B%0Aif(%20confirmRes%20!%3D%20true%20)%20%7B%0A%20%20return%3B%0A%7D%0A%0Alet%20secondsDelay%20%3D%20prompt(%22Seconds%20between%20downloads%3A%22%2C%20%221%22)%3B%0Aif(%20secondsDelay%20%3D%3D%20null%20)%20%7B%20return%3B%20%7D%0Aconst%20regex1%20%3D%20%2F%5E(%5Cd%2B)%24%2Fg%3B%0Alet%20matches1%20%3D%20regex1.exec(secondsDelay)%3B%0Aif(%20matches1%20%3D%3D%20null%20%7C%7C%20matches1.length%20%3C%202%20)%20%7B%0A%20%20%20%20alert('Seconds%20entered%20is%20invalid.')%3B%0A%20%20%20%20return%3B%0A%7D%0AsecondsDelay%20%3D%20parseInt(secondsDelay)%3B%0Alet%20startRange%20%3D%20prompt(%22Enter%20the%20start%20row%20number%20(first%20row%20is%201).%5CnEnter%20a%20dash%20followed%20by%20another%20row%20number%20to%20specify%20a%20start-end%20range.%5CnThe%20next%2050%20rows%20are%20downloaded%20if%20no%20end%20range%20is%20specified.%5Cn%5CnExamples%3A%5Cn%20%201%20%20downloads%20rows%201-50%5Cn%20%20101-160%20%20downloads%20rows%20101-160%5Cn%5CnStart%20row%20number%20%2F%20start-end%20range%3A%22%2C%20%221%22)%3B%0Aif(%20startRange%20%3D%3D%20null%20)%20%7B%20return%3B%20%7D%0Aif(%20secondsDelay%20%3C%201%20)%0A%20%20secondsDelay%20%3D%201%3B%0Alet%20rowStart%20%3D%201%3B%0Alet%20rowEnd%20%3D%20rowStart%2B50-1%3B%0Aconst%20regex2%20%3D%20%2F%5E(%5Cd%2B)(%3F%3A-(%5Cd%2B))%3F%24%2Fg%3B%0Alet%20matches2%20%3D%20regex2.exec(startRange)%3B%0Aif(%20matches2%20%3D%3D%20null%20%7C%7C%20matches2.length%20%3C%202%20)%20%7B%0A%20%20%20%20alert('Row%20start%20number%20or%20start-end%20range%20is%20invalid.')%3B%0A%20%20%20%20return%3B%0A%7D%0A%0Aif(%20matches2.length%20%3D%3D%203%20%26%26%20matches2%5B2%5D%20!%3D%20null%20)%20%7B%0A%20%20%20%20rowStart%20%3D%20parseInt(matches2%5B1%5D)%3B%0A%20%20%20%20rowEnd%20%3D%20parseInt(matches2%5B2%5D)%3B%0A%20%20%20%20if(%20rowEnd%20%3C%20rowStart%20)%20%7B%0A%20%20%20%20%20%20alert('End%20row%20number%20must%20be%20greater%20than%20start%20row%20number.')%3B%0A%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%0A%7D%20else%20%7B%0A%20%20%20%20rowStart%20%3D%20parseInt(matches2%5B1%5D)%3B%0A%20%20%20%20rowEnd%20%3D%20rowStart%2B50-1%3B%0A%7D%0AdownloadS3(rowStart%2CrowEnd%2CsecondsDelay)%3B%0A%7D)()%3B%7D)()%3B
S3 Downloader Bookmarklet Limitations
This simple bookmarklet has some limitations.
No checkboxes can be checked
The S3 Downloader Bookmarklet assumes all checkboxes are unchecked in the current Objects view of the S3 Console. If 1 or more rows are checked, the download button will be disabled and this script will fail to invoke the download action.
Folders cannot be downloaded
Any objects that are folders (a key path that leads to more files) will not be downloaded. You will need to navigate into that path in order to download the files within it.
Input validation is limited to digits
The input validation uses simple regular expressions to match 1 or more digits. An alert message will appear if the input values are not valid.
About the S3 Downloader Bookmarklet
The S3 Downloader Bookmarklet has been released under the MIT License and is available on GitHub.
The following resources may be used to create Bookmarklets.
Bookmarklet Resources
Making Bookmarklets is an excellent introduction how Bookmarklets work with an example how to get started.
Bookmarklet Maker allows you to generate JavaScript that is safe to use as a bookmark URL. The site also includes suggestions and tips how to get started.
S3 Downloader License
MIT License
Copyright © 2025 Angelo Mandato
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
Top comments (0)