Files URL Exporter
Get the link of every file you uploaded to Shopify Files, check that each one loads, and fill the image columns of a product CSV.
1Paste one file link from your store
In Shopify, go to Content > Files and click the link icon next to any file. All your files share the start of that link.
2Add your file names
1Run this query on your store
- Install Shopify’s GraphiQL app on your store and tick the
read_filesscope. - Paste the query into the main box and the variables into the Variables box.
- Run it, then copy the whole response on the right.
- Save the query as
files.graphqland the variables asvariables.json. - Run these commands, then drop or paste
page-1.jsonbelow.
shopify store auth --store your-store.myshopify.com --scopes read_files
shopify store execute --store your-store.myshopify.com \
--query-file files.graphql --variable-file variables.json --output-file page-1.jsonIf Shopify says the query cost is too high, choose a smaller number.
query FilesForExport($cursor: String) {
files(first: 100, after: $cursor, sortKey: ID) {
pageInfo {
hasNextPage
endCursor
}
nodes {
__typename
id
alt
createdAt
fileStatus
... on MediaImage {
mimeType
image {
url
width
height
}
originalSource {
fileSize
}
}
... on GenericFile {
url
mimeType
originalFileSize
}
... on Video {
filename
originalSource {
url
mimeType
fileSize
}
}
... on Model3d {
filename
originalSource {
url
mimeType
filesize
}
}
}
}
}{
"cursor": null
}Thousands of files? The bulk export recipe returns them all in one download, and its file can be dropped below too.
2Paste the response
There are more files. Run the query again with these variables, then paste the new response. It’s added to the list.
Links
3Fill a product CSV (optional)
Files are matched to products by name: trail-tee.jpg, trail-tee-2.jpg match the product with URL handle trail-tee; TEE-RED-S.jpg matches the variant with that SKU and becomes its variant image.
Back up first. In Shopify, go to Products > Export and save a copy before you import. Importing this file changes the image links of the products in it. Shopify downloads each image during the import.
What to know about Shopify file links
- Shopify may rename files
- It adds an ID when the name is already used (including product uploads) or ends in a size word like
_small. Links built from names are marked when this is likely. - Spaces and symbols
- Shopify doesn’t publish its rules. We apply the changes merchants have measured (spaces and symbols to underscores, accents removed) and flag every name we changed.
- The ?v= number
- A version for caching. Links load without it, but a replaced file can keep showing the old version at a link without it.
- The check
- Images are loaded straight from Shopify in your browser. PDFs and other files can’t be checked this way and are marked “not checked”.
Guides
Questions
Why can’t I just export my file links from Shopify?
Content > Files has a copy-link button for one file at a time and no export. This tool either builds the links from your file names or turns Shopify’s own file list (from the free GraphiQL app) into a CSV.
Are my images uploaded anywhere?
No. When you choose a folder, only the file names are read; the images aren’t opened. The link check loads each image straight from Shopify’s CDN in your browser, the same way a web page would.
Why do some built links fail the check?
Usually because Shopify renamed the file when you uploaded it: it adds an ID when a file with the same name already exists, or when the name ends in a size word like _small. Use Export with GraphiQL to get the real names.
Do the links need the ?v= part?
No, they load without it. ?v= is a version number Shopify changes when a file is replaced. Built links can’t know each file’s number, so they leave it off. The GraphiQL export gives you both.
Can it check PDFs and other files?
Only images can be checked from a web page. Other files are listed with their links and marked “not checked”; open one to make sure.
Will importing the filled CSV change my products?
Yes, that’s what it’s for. Export your products from Shopify first as a backup. Products that already have images are left alone unless you choose to replace them.
Not affiliated with, endorsed by, or sponsored by Shopify Inc. Shopify is a trademark of Shopify Inc.