Closed GoogleCodeExporter closed 8 years ago
Files uploaded though html forms can be accessed in the $_FILES array, not the
$_POST array. When the form is submitted, try doing a print_r on the $_FILES
array
and you should see your file information.
Also, the addFile function only accepts three values following the format
provided
below...
function addFile($label, $name, $additionalParams="")
Please let me know if you have any additional questions and I will assist.
Thanks,
- Andrew
Original comment by ajporterfield@gmail.com
on 13 Mar 2010 at 5:55
Hi.
Kind greetings from Germany :-)
Thanks for this very very fast reply!
> Files uploaded though html forms can be accessed in the $_FILES array, not
> the $_POST array.
Ah, ok.
You should make a note in the example pages to point this out.
> When the form is submitted, try doing a print_r on the
> $_FILES array
> and you should see your file information.
Nope. It still not work.
>
> Also, the addFile function only accepts three values following the format
> provided
> below...
>
> function addFile($label, $name, $additionalParams="")
Ok then something is wrong.
When you look at the elements example page you see this.
After:
//Below you will find functions for adding each of the 18 supported form field
types.
[..]
function addFile($label, $name, $value="", $additionalParams="")
> Please let me know if you have any additional questions and I will assist.
Here we go:
I have tried this:
$form->addFile("File:", "field13"));
And
echo "The File Vars:";
print_r($_FILE);
right after the print_r($_POST) statement.
Output is:
Array
(
[cmd] => submit
[field0] =>
[field15] =>
[field1] => Array
(
[0] => option0
[1] => option1
[2] => option2
)
[field3] =>
[field4] => option0
[field7] =>
[field8] =>
[field11] =>
[field12] =>
[field14] =>
[field16] =>
[field17] => <br />
[field18] =>
[recaptcha_challenge_field] =>
02B_JVQ7mkZhsEo5WVRd6Czk1I1oT-4jBsP-i1VY2YzO3ckyuO-EJyox8VgDBmlk08MIFpzB_YyLfehv
dZyOzZOZvRoOcXz_PTjd4KuqCU2uTQfdmc-Vw0S4jSIoxoXQ8Cdzu2I55_xC_6-cXD_AbDcIQuL7MkSI
y64Tzje82Jv9GnVHrmbLznqw0kbAWB2NF0jQz7dmdvpEVElDwhpFBGDy5MhWFvW36w81qwkNB7vrmCLo
gvTXWAiRL-WUZiuV8dp2P8xN-PEsSfyW6NrvFim1Gis2YB
[recaptcha_response_field] =>
)
The File Vars:
^ as you can see, there is nothing to see :-)
What am I doing wrong?
Do you have an working example for me please?
Thanks in advance!
Ralf
Original comment by rennradt...@googlemail.com
on 13 Mar 2010 at 7:46
Ralf,
Kind greetings to you from the US :) In the code you provided above, I see you
are
doing...
print_r($_FILE);
You need to change this to...
print_r($_FILES);
php.net is a great site for all things php related. Check out
http://us2.php.net/manual/en/features.file-upload.post-method.php for more
information and instruction on how file uploads are handled in php.
Thanks,
Andrew
Original comment by ajporterfield@gmail.com
on 13 Mar 2010 at 7:57
Hi.
>In the code you provided above, I see
>you are
>doing...
>print_r($_FILE);
>You need to change this to...
>print_r($_FILES);
Argl!! OK I'am stupid.
Sorry for the hassle!
But to mention the $_FILE thing in the examples would help a lot.
Thanks for the help and keep up the good work, the form_class is really
helpful!
Ralf
Original comment by rennradt...@googlemail.com
on 13 Mar 2010 at 8:19
Original issue reported on code.google.com by
rennradt...@googlemail.com
on 13 Mar 2010 at 5:39