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:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 12:47 PM
> To: [EMAIL PROTECTED]
> 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.
>
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to