Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I know how to download all the pictures link by link, but i need to bulk download all the pictures i loaded on the website in one move. For backup purpose. Is that possible?
@francesco4 let me go full SuperSayan on this:
function downloadFileList() { var assets = $("#assets-table input[type=text]") assets.each(function (index, input) { var filename = input.value.split('?')[0]; files.push(filename); }); downloadFile(); } function downloadFile() { var downloader = $("<a id='download-generated-file' href='' download='files-list.txt'></a>") var data = 'data:application/octet-stream;base64,' + window.btoa(files.join("\n")); $('body').append(downloader) $('#download-generated-file').attr('href', data); $('#download-generated-file')[0].click(); } var files = [];downloadFileList();
Let's say the filename is now files-list.txt. Copy this to a specific folder on your computer. Now we want to get every file in this file automatically.
You now have a folder with all the files and images from this Shopify websites files folder.
Boakashaa!
Enjoy mate!
Aivis Zvezdovs / ANTI 404
Labdien!
Šodien mēģinu izpildīt Jūsu augstākminēto darbību, lai tiktu pie visiem SHOPIFY failiem, diemžēl man neizdodas, iekopējot scriptu parādās sekojošs teikums:
Uncaught SyntaxError: Unexpected identifier
Vai varat kā palīdzēt?
Paldies!
Hey @francesco4 @Zvezdovs and @DainaRozenberga
Renars here from Matrixify app.
In the Matrixify app, we have now developed the ability to export Shopify File details such as public links.
You can use the app exported links to bulk download files using the terminal/command prompt. Here we even have a great tutorial on how to do just that - Download all files from Shopify Files to your computer.
If you have any questions or issues along the way, you can always reach out to our support directly.
-------------------
Sveiki @DainaRozenberga ,
Renārs šeit no Matrixify app.
Matrixify aplikācijā ir pieejama iespēja eksportēt Shopify Files informāciju un datus, piemēram, publikās saites.
Šo aplikācijas funkcionalitāti lai eksportētās saites var izmantot lai lejupielādētu failus izmantojot datora terminal/command prompt.
Šeit var atrast mūsu pamācības lapu kā to izdarīt - Download all files from Shopify Files to your computer.
Ja jums ir kādas neskaidrības vai problēmas ejot caurti šim procesam, varat sazināties ar mūsu palīdzības komandu.
Tried your script. Produces the following error in Firefox console.
Uncaught SyntaxError: unexpected token: identifier
@Zvezdovs Tried the script. thank you.
Produces the following error in Firefox console.
Uncaught SyntaxError: unexpected token: identifier
Looking up this error, found that this could be a missing ;
Your thoughts?
Dob’t use code, Try Filetastic. It lets you browse all files from your store nicely grouped into folders, and you can bulk download them too
We created a free Shopify app that allows you to download all your files in one click, compressed to a zip archive.
It's called Filey, check it out.
Feel free to reach me out with feedback, or functionality requests.
Leaving a review is much appreciated.
So easy! Thanks Mashkovtsev.
Amazing plugin, makes dev work so easy 🙂
Hi there,
I tried your app and it worked great however it didn't download the header images I have in my shop. Any idea why or how I can do it? thank you
If someone stumbles on this thread. Here is a slightly modified version of Arif's above script which works with video assets also and gets the most master asset.
Does not work with mp3 or "other" types of files
It will also automatically start a download of the files to your computer. Hope it helps someone!
function getAllFileUrls() {
const table = document.querySelector('.Polaris-IndexTable__Table'); // Locate the table
if (!table) {
console.error('Table not found!');
return;
}
// Select all `img` elements in the table
const imgElements = table.querySelectorAll('img');
const fileUrls = [];
imgElements.forEach(img => {
const row = img.closest('.Polaris-IndexTable__TableRow')
const fileType = row.querySelector('.Polaris-Text--root.Polaris-Text--bodyMd.Polaris-Text--subdued').innerHTML.toLowerCase()
let url = img.getAttribute('src');
if (url) {
const video = extractImageID(url);
if(video) {
url = `https://cdn.shopify.com/videos/c/o/v/${video}.${fileType}`
} else {
url = url.replace("_200x200", "");
}
fileUrls.push(url); // Add URL to the array
}
});
console.log('File URLs:', fileUrls);
return fileUrls;
}
function extractImageID(url) {
let match = url.match(/\/preview_images\/([^/]+)\.thumbnail/);
return match ? match[1] : null;
}
async function downloadFile(url) {
try {
const response = await fetch(url);
const blob = await response.blob();
const link = document.createElement("a");
// Use the last part of the URL as the filename (before query string)
link.href = URL.createObjectURL(blob);
link.download = url.split("/").pop().split("?")[0];
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(link.href);
} catch (error) {
console.error("Failed to download file:", error);
}
}
// Utility function to add a delay
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function downloadAllFiles() {
const urls = getAllFileUrls()
for (const url of urls) {
await downloadFile(url);
await sleep(500); // Add a 500ms delay between downloads to avoid blocking
}
}
downloadAllFiles();
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025