Shopify Theme Development - Help Me Understand The 'files' URL

- 1 answer

I am developing a section that will need to pull images through from the 'files' folder.

I will have images a.png, b.png & c.png all saved within the 'files' folder. I will then loop through an array of image names array = [a,b,c].

My first question is, as I loop through am I able to go to one of the 'files' directories, say for a.png with the file location of file:///

Can I grab the start of the file URL file:/// then put an a the value from the array in at the end? file:/// + array[0] + .png

The above is just how I plan to use the variable and already have successful code so long as the 'files' URL start remains the same, but can anyone explain the files URL to me? file:/// What is the /s/ + /1/ + /0043/ + /0886/ + /0977/?



Yes they will be unique to your store here is a sample from a test store of mine

Nothing is the same (except the files and 1).

If you plan to change them with JS you will need to use RegEx and swap only the name part of the image.