0

when i upload a file before uploading i just print the file array by using print_r($_FILES); it will print following array.

[image] => Array ( [name] => [type] => [tmp_name] =>

[error] => 4 [size] => 0 ) )

so whats reason besides it that will not give actual file attributes.

2
  • Yeah accept some answers but anyways post some code because if your enctype is ok we need to see some code something is wrong. Commented Aug 7, 2010 at 2:50
  • Please provide the code of the upload form, php file. Commented Oct 27, 2016 at 8:32

2 Answers 2

4

To the upload form, you must add the enctype multipart/form-data

as:

<form action="me.php" enctype="multipart/form-data" method="post">
</form>
Sign up to request clarification or add additional context in comments.

1 Comment

thanks yeah i used this enctype="multipart/form-data" but still same problem
0

In your form, are you setting the encoding type correctly?

ENCTYPE="MULTIPART/FORM-DATA"

What OS is your server running?

2 Comments

thanks yeah i used this enctype="multipart/form-data" but still same problem. and os is windows xp sp-2
For some reason I have had problems using $_FILES on windows servers. Google search did not come up with anything. Have you checked the relevant file-upload settings in your php.ini file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.