Notice: Undefined offset: 13020558 in /var/www/html/qa-external/qa-external-users.php on line 744
How do I upload an image and show that via HTML - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How do I upload an image and show that via HTML

+17 votes
asked Aug 30, 2024 by (220 points)
I just want to use

<img src = "local file that I upload">. Can I do this?

3 Answers

0 votes
answered Sep 3, 2024 by Peter Minarik (101,420 points)
edited Sep 4, 2024 by Peter Minarik
Yes, you can, but you need to put the file on a location that's available for the HTML. Either on the same server where your HTML code lives or another server that's accessible from your HTML file, such as public web sites (e.g. https://imgur.com/ or any other site that allows you to upload images).
0 votes
answered Sep 5, 2024 by Nilla Amalia (230 points)
tidak anda harus menggunakan cout<<"file lokal yang saya unggah";
0 votes
answered Sep 18, 2024 by Jitendra Singh Chouhan (190 points)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Image Display</title>
</head>
<body>
    <h1>My Image</h1>
    <img src="image.jpg" alt="Description of the image">
</body>
</html>
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...