file upload then insert into mysql
| From: | Mark Lo | Date: | Mon, 07 Aug 2000 11:02:50 +0000 |
| Subject: | file upload then insert into mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10447@lists.php.net to get a copy of this message | ||
Hi,
I have a questions about file uploading and inserting into mysql.
As I know, when php upload a file, then it will store in the tmp directory. so we have to copy it
into specific directory. like...if(!copy($userfile, "/hme/directory/$userfile_name")
.....if it is not upload successfully, then {echo 'copy faild'} else { insert the values
into the database}...
the code should be written as
if (!copy($userfile, "/home/directory/$userfile_name")
{echo 'copy failed';}
else
{....insert some values into mysql...}
I have a question for this, if the user terminate the upload process while uploading. Then, what
will be happened. I mean which part of script will be exec??
Thank you
Mark Lo