Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Image Upload in PHP (http://www.go4expert.com/forums/image-upload-php-t6450/)

idz 20Sep2007 09:20

Image Upload in PHP
I am trying to upload a image from my computer to the "Image" Folder created in C:\wamp\www\.(My Document root is set to C:/wamp/www//test) & when I run this program it should display the image in the same browser window.But the following code is not working.
HTML Code:

<head><title>Upload Files</title>
<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="img"/><br>
<input type="submit" value="click to upload"  name="sub">
<? php

                <img src="images/<?php echo $file; ?> "border="0" />


Any suggestion what is wrong with the above code?
Any help would be greatly appreciated.

idz 20Sep2007 13:41

Re: Image Upload in PHP
I am getting the following error when i click the "Upload" button ->
"Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\php10.tmp' to 'images/abc.jpg' in C:\wamp\www\prosenjit\upload.php on line 17"
And,I am using Firefox Browser.
Kindly if you guide me...
Also, is these code line correct? ->
<img src="images/<?php echo $file; ?> "border="0" />
I feel there is somthing wrong :confused:
Anyone there to guide me plzz? :rolleyes:

shabbir 20Sep2007 14:55

Re: Image Upload in PHP
idz you seems to be not getting how to make posts in the forums and read the Before you make a query thread to make things clear.

pradeep 20Sep2007 15:26

Re: Image Upload in PHP
The filesystem path and the URI path may not be the same, please check!

All times are GMT +5.5. The time now is 16:49.