Ask coding questions

← Back to all posts
How to upload images in html
afm555 (0)

How do you put in images from your files into a website? (Btw i'm on chrome)

Answered by QuantumCodes (25) [earned 5 cycles]
View Answer
Comments
hotnewtop
QuantumCodes (25)

<img src = "put link here"> btw, somehow when i tried putting <img src="img.png"> and img.png was in replit, it didnt work. So, instead if you can, host your image online...

afm555 (0)

@QuantumCodes thank you so much, I didn't know you had to upload the image into replit.

QuantumCodes (25)

@afm555 actually.... how did u do it? XP i tried but i failed... so i used a http link... Fact: i actually use scratch : Ankit_Anmol but... i am banned

afm555 (0)

@QuantumCodes you have to upload the image in to replit, there's a button that says upload file

QuantumCodes (25)

@afm555 i know how to upload... idk how to img src thing.. it just doesnt work for me. You saves where? In the same folder as the html file?

codingjlu (481)

Well, if you want to permanently upload it, you need a backend like Python, PHP, Node.js, Java, or Go.

ch1ck3n (2343)

<input type="file">

afm555 (0)

@ch1ck3n what do i put in the src?

afm555 (0)

@ch1ck3n then how would it know what image to put?

afm555 (0)

@ch1ck3n the src is what the image is, what do I put there?

ch1ck3n (2343)

@afm555 ohh

you can't directly pull files from a user's computer

they have to upload it

afm555 (0)

@ch1ck3n then how do you upload it?

afm555 (0)

@ch1ck3n tell me what I did wrong, but i put in, <input type="Logo1.jpg">

ch1ck3n (2343)

@afm555 <input type="file"> AND NOTHING ELSE

YOU CANT SPECIFY WHICH FILE

afm555 (0)

@ch1ck3n oh, your talking about the wrong thing. I mean how do I input a an image from MY computer?

ch1ck3n (2343)

@afm555 <img src="Logo1.png">

afm555 (0)

@ch1ck3n https://northerntechgamesandsoftware.afm555.repl.co/ I'm trying to put a second image after the first one.

afm555 (0)

@ch1ck3n what works for you?