Hi all,
Can I get a simple snippet to upload an image in php and display it on the webpage which i have developed but not yet published? I have tried 2-3 codes but they dont seem to be working..please help me!!!
maunica
0
Newbie Poster
Recommended Answers
Jump to PostCould you please paste your code which is not working? I'll try to fix it.
Jump to PostWell there are errors in your code like
$size=filesize($_FILES['image']['tmp_name']);
should be$size=filesize($_FILES['image']['size']);
You can try the following<html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html>
upload_file.php
<?php …
All 5 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.