Skip to content
Sign upLog in

How to upload images in html

Profile icon
afm555

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

You are viewing a single comment. View All
Answered by QuantumCodes [earned 5 cycles]
View Answer
Profile icon
ch1ck3n

<input type="file">

Profile icon
afm555

@ch1ck3n
what do i put in the src?

Profile icon
ch1ck3n

@afm555
nothing

Profile icon
afm555

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

Profile icon
ch1ck3n

@afm555
wdym

Profile icon
afm555

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

Profile icon
ch1ck3n

@afm555
ohh

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

they have to upload it

Profile icon
afm555
Profile icon
afm555

@ch1ck3n
then how do you upload it?

Profile icon
ch1ck3n

@afm555
<input type="file">

Profile icon
afm555

@ch1ck3n
tell me what I did wrong, but i put in,

Profile icon
ch1ck3n

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

YOU CANT SPECIFY WHICH FILE

Profile icon
ch1ck3n
Profile icon
afm555

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

Profile icon
ch1ck3n

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

Profile icon
afm555

@ch1ck3n
not working for me

Profile icon
ch1ck3n

@afm555
send me your repl

Profile icon
afm555

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

Profile icon
ch1ck3n

@afm555

image

works for me

Profile icon
afm555

@ch1ck3n
what works for you?