[thelist] darkness is still winning to light... <Was PHP missfunction on loading a file from a HTML FORM>

Phil Turmel philip at turmel.org
Wed Apr 6 06:46:01 CDT 2005


Joan Olivé M. wrote:
[snip]
> It's still without working.
> The form is in:   http://www.bbcard.org/prova-05-04-05/bbcard-presupuesto.htm

> 
>   mail($destino,$subject,$cuerpo1,$mailheaders);
> 
>   include("gracias.htm");

> and now, when testing the form, everithing works but de "loading file" option. The message received is:

> Fitxer adjunt: /tmp/phpRFPEyr    >> 
[/snip]

Joan,

PHP file upload places the received file in a temporary location just 
long enough for your PHP script to move it to the desired location on 
your server.  If you don't move it with move_uploaded_file(), it will be 
DELETED when the script ends.  See the documentation and examples here:

http://us4.php.net/manual/en/features.file-upload.php
http://us4.php.net/manual/en/function.move-uploaded-file.php

Your form is working.  PHP is working as documented.  You must add to 
your script an appropriate move_uploaded_file() function.

HTH,

Phil


More information about the thelist mailing list