This is a discussion on simple upload and save jpeg within the PHP Language forums, part of the PHP Programming Forums category; OK, this is my first time trying to let folks upload a picture and save it. I use a very ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
OK, this is my first time trying to let folks upload a picture and save
it. I use a very basic html file input from <form action="picact.php" method="post" enctype="multipart/form-data"> <input name="picture_name" type="file" id="picture_name"> <input type="submit" name="Submit" value="Submit"> </form> In picact.php I try to run a simply copy function if(!(copy($picture_name, "images/picupload.jpeg"))){ echo "trouble"; } else { echo "worked";} it tells me it worked, but there is no file in the images folder, so I don't know what is going wrong. does anyone have any advice? I am using a static file name for now, to avoid any trouble with variable names. thanks, paul |
|
|||
|
googlegroups@paul13.com wrote:
> OK, this is my first time trying to let folks upload a picture and save > it. I use a very basic html file input from > > <form action="picact.php" method="post" enctype="multipart/form-data"> > <input name="picture_name" type="file" id="picture_name"> > <input type="submit" name="Submit" value="Submit"> > </form> > > In picact.php I try to run a simply copy function > > if(!(copy($picture_name, "images/picupload.jpeg"))){ > echo "trouble"; } > else { > echo "worked";} > > it tells me it worked, but there is no file in the images folder, so I > don't know what is going wrong. does anyone have any advice? > > I am using a static file name for now, to avoid any trouble with > variable names. > thanks, > > paul > You are totally on the wrong track. Please read: http://www.php.net/manual/en/features.file-upload.php On that page you will find a example how it should be done. Franck Nijhof BlueSolid Software |