I need to download all the media from my shopify website. How can i do that?

I need to download all the media from my shopify website. How can i do that?

francesco4
Tourist
12 0 4

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?

Replies 12 (12)

Zvezdovs
Excursionist
26 0 11

@francesco4 let me go full SuperSayan on this:

  • Go to Settings -> Files
  • Adjust the URL to /admin/settings/files?limit=250 (this will show 250 files per page instead of 50)
  • Open up your browser console
  • Paste in the following scripts in there, this will offer you a file with all the names of the files on that specific page

 

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&colon;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();​

 

  • Do this manually for each page with files and combine them all in one big file with all the filenames you want to download

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.

  • Open up your terminal
  • Navigate to that specific folder you just created
  • Execute this command: wget -i files-list.txt (requires wget)

You now have a folder with all the files and images from this Shopify websites files folder.

Boakashaa! 

Enjoy mate!
Aivis Zvezdovs / ANTI 404

Hire me - zvezdovs@gmail.com
Did my answer helped you? A like would be appreciated!
Shopify is a great platform and will make you a ton of profit, if executed correctly.
Push it to make your store as perfect as you can, or hire a professional to take your store to next level.
DainaRozenberga
Visitor
1 0 1

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!

Renars
Shopify Partner
315 32 379

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.

Matrixify | Bulk Import Export Update | https://apps.shopify.com/excel-export-import | https://matrixify.app
mlr290
Visitor
2 0 0

Tried your script.  Produces the following error in Firefox console.

Uncaught SyntaxError: unexpected token: identifier

mlr290
Visitor
2 0 0

@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?

TwoColors
Shopify Partner
78 0 23

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

Maciej Tokarczyk

mashkovtsev
Shopify Partner
43 1 27

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.

All the best.
Alex, Team Lead at INSO.codes Shopify Studio
https://inso.codes/
mashkovtsev
Shopify Partner
43 1 27

Here's an updated link for Filey

All the best.
Alex, Team Lead at INSO.codes Shopify Studio
https://inso.codes/
FreshMarketing
Shopify Partner
7 0 2

So easy! Thanks Mashkovtsev.

EllaW
Shopify Partner
4 0 0

Amazing plugin, makes dev work so easy 🙂

Liatula
Visitor
2 0 0

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

 

ScarletKyri
Shopify Partner
4 0 0

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();