|
From: "Emiliano Boragina" on 2 Apr 2008 19:00 Hello I have the next code: -- archive_a_subir.php -- <form action="archivo_subir.php" method="post" enctype="multipart/form-data"> <input type="file" name="file"> <input type="submit" value="ADJUNTAR ARCHIVO"> </form> In archive_subir.php: <? $carpeta = "subidos"; // nombre de la carpeta ya creada. chmool 777 (todos los permisos) copy($_FILES['file']['tmp_name'] , $carpeta . '/' . $_FILE ['file']['name']); ?> You can see this in http://www.portbora.com.ar/foro/archivo_a_subir.php, when I run these appears the next warning Warning: copy(subidos/) [ <http://www.portbora.com.ar/foro/function.copy> function.copy]: failed to open stream: Is a directory in /home/pu000561/public_html/foro/archivo_subir.php on line 3 Why this? How can I run correctly? Thanks. + _ // Emiliano Boragina _ // Diseño & Comunicación ////////////////// + _ // emiliano.boragina(a)gmail.com / // 15 40 58 60 02 /////////////////////////// + _
From: Chris on 2 Apr 2008 19:21 > $carpeta = "subidos"; // nombre de la carpeta ya creada. chmool 777 > (todos los permisos) > > copy($_FILES['file']['tmp_name'] , $carpeta . '/' . $_FILE > ['file']['name']); It's $_FILES not $_FILE (an 's' on the end). It's always worth using error_reporting(E_ALL) and ini_set('display_errors', true) when doing development, this would have triggered a notice or warning (can't remember which). -- Postgresql & php tutorials http://www.designmagick.com/
From: "tacio vilela" on 4 Apr 2008 13:03 Hi, try this, $carpeta = $_SERVER['DOCUMENT_ROOT']."/subidos"; // nombre de la carpeta ya creada. chmool 777 (todos los permisos) copy($_FILES['file']['tmp_name'] , $carpeta . $_FILE['file']['name']); Regards, Tacio Vilela 2008/4/2 Chris <dmagick(a)gmail.com>: > > $carpeta = "subidos"; // nombre de la carpeta ya creada. chmool > > 777 > > (todos los permisos) > > > > copy($_FILES['file']['tmp_name'] , $carpeta . '/' . $_FILE > > ['file']['name']); > > > > It's $_FILES not $_FILE (an 's' on the end). > > It's always worth using error_reporting(E_ALL) and > ini_set('display_errors', true) when doing development, this would have > triggered a notice or warning (can't remember which). > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- /******************************************* *** *** *** Tácio Vilela *** *** MSN: taciovilela(a)hotmail.com *** *** SKYPE: taciovilela *** *** *** *******************************************/
|
Pages: 1 Prev: mssql_connect error only on command line Next: php4 to php5 |