Jump to content

[SOLVED]how to find the value of an input file


Safwen

Recommended Posts

hi guys,

i want to find the $_FILES[] values (name , size etc) of an input file field in my form

it seems that

Tools::getValue("image");

doesn't work when i print the result.

 

so i have tried that

var_dump($_FILES['image']);

but i get nothing just an empty array.

 

how to do that please ? thanks in advance

Link to comment
Share on other sites

that's right, it looks well.

So, you've got <input type="file" name="images" /> and when you add file to it, and then - submit form

you cannot get an access to the $_FILES variable

 

this variable doesn't exist at all? can you try with var_dump($_FILES) ?

 

can you for test purposes create other input in this form, for example: <input type="text" name="testinput" value="1" />

and then try with var_dump($_POST['testinput']); - does it work well?

Link to comment
Share on other sites

i have solved that  instead of that 

<form name= "myform" enctype="multipart/form-data" method="post" action="add_product.php">

i put that 

<form name="myform" id="myform" action="{$request_uri|escape:'htmlall':'UTF-8'}" method="POST" enctype="multipart/form-data">

everything is going well now

Edited by Safwen (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...