How do I upload an image file?


#1

Hello!

I’m creating a website using Glitch, and I was wondering if it was possible to upload an image file which I can then access with HTML. Otherwise, when I want to upload an image everyone can see no matter what browser they’re using, and the same with the Favicon.

As far as I’m concerned I need to upload the image to another website and copy the image URL from there. Correct me if I’m wrong.

Thanks!


#2

Hey Crazykk1449,

You can upload an image for your website directly into your project without having to use another site:

  1. Open up your projects assets and drag an image from your desktop into it
  2. click the uploaded file to get the url
  3. use that url in your code

#3

Thank you pketh! That’s really helpful :smile:


#4

didn’t work work for me.


#5

When you upload an image to assets, you will get a cdn.glitch.com link that you can use. If you want to directly upload it to your site (like yoursite.glitch.me/image.png) you will need to use code to upload it.


#6

Did you get an error when uploading?


#7

how would you do that


#8

You can use wget from the command line using the uploaded asset’s URL to import it in to your project locally.