simple upload and save jpeg

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-09-2005
googlegroups@paul13.com
 
Posts: n/a
Default simple upload and save jpeg

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

Reply With Quote
  #2 (permalink)  
Old 02-09-2005
Franck Nijhof - BlueSolid Software
 
Posts: n/a
Default Re: simple upload and save jpeg

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0