RE: [PHP] File input in form

From: Date: Mon, 16 Feb 2004 17:46:57 +0000
Subject: RE: [PHP] File input in form
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-177834@lists.php.net to get a copy of this message
Sounds like a scope problem. I suggest using $_FILES['fichier'] inside the function since $_FILES is a superglobal and is accessible everywhere. If you use this method, you won't need to pass anything to the function. Shaunak > -----Original Message----- > From: marc serra [mailto:mserra@gdwd.com] > Sent: Monday, February 16, 2004 12:47 PM > To: php-general@lists.php.net > Subject: [PHP] File input in form > > > Hi, > > > > I'm designing a form with an file upload process. > > > > So I've wrote something like this: > > > > <form ENCTYPE="multipart/form-data" action="valid_form.php" > method="POST"> > > <input type="file" name="fichier"/> > > <input type="submit" value="submit"/> > > </form> > > > > > > This work perfectly and now I got my file valid_form.php which receive the > data: > > > > In that page I want to call a function to store file like this > > storeFile($fichier); > > ps :when I write : "echo $fichier_name" the name of the file is displayed. > > > > My problem is that in the function storeFile when I want to save > data I got > an error and when I write: > > "echo $fichier_name;" nothing appear like if it > doesn't know my > file.. > > > > So can you please tell me how to call a function with file in parameter to > store it. > > > > Thx in advance, > > > > Marc. > > > >

« previous php.general (#177834) next »