Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CodeBrotha/0ceec3d293b9cfd41309b44addf06b4f to your computer and use it in GitHub Desktop.
Save CodeBrotha/0ceec3d293b9cfd41309b44addf06b4f to your computer and use it in GitHub Desktop.
Download Assets From Shopify Store Files
  1. Go to https://YOURSTORENAME.myshopify.com/admin/settings/files?limit=250

  2. Open Dev Tools, and go to Console tab.

  3. In Console paste the code below to download shopify-files.html file.

function fetchPageAssets() {
  let images = document.querySelectorAll('img[src*=files]');
  images.forEach(function(image) {
    files.push('<a href="' + image.src.replace(/_60x60/, "") + '"><img src="' + image.src.replace(/_60x60/, "") + '">');
  });
}

function downloadListFile() {
  let button = document.createElement("a");
  let data = 'data:application/octet-stream;base64,' + window.btoa(files.join('\n'));
  button.id = "download-file";
  button.href = data;
  button.download = "shopify-files.html";
  document.querySelector("body").append(button);
  button.click();
}

var files = []
files.push('\n')
fetchPageAssets()
files.push('\n\n')
downloadListFile()
  1. Open that file in Chrome browser, let it finish loading.

  2. File > Save file as... and choose a folder to download the page and all images to.

  3. Log into the other store and upload the images you need in Settings > Files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment