-
Go to the assets folder in your project and select the image you want to upload locally to your Glitch project. Click on the ‘copy url’ button. This will copy an image url like
https://cdn.glitch.com/f6254aa9-8051-48db-bbc1-5e7766f748c5%2Fw6.jpg?1531238960521
to your clipboard. -
Go to the console in Glitch, and if you don’t already have an assets folder, type
mkdir assets
and hit enter. -
type
cd assets
and hit enter to move into the assets folder -
type
wget
and then paste the image url you copied previously into the console, so you see something likewget https://cdn.glitch.com/f6254aa9-8051-48db-bbc1-5e7766f748c5%2Fw6.jpg?1531238960521
and hit enter. That’ll import that image to your assets folder. Note that it’ll be imported with the namef6254aa9-8051-48db-bbc1-5e7766f748c5%2Fw6.jpg?1531238960521
. To make it easier to deal with you’ll want to rename it. To do so, typemv /app/assets/f6254aa9-8051-48db-bbc1-5e7766f748c5%2Fw6.jpg?1531238960521 /app/assets/w6.jpg
and hit enter. You can confirm the asset renamed correctly by typingls -al
and you’ll see a list of files, one of which should be calledw6.jpg
. -
Repeat steps 1 and 4 for each image you want to upload. Be sure to change the name of the file to the relevant one in step 4.
The path you’ll then use is: __dirname + '/assets/w6.jpg'