NYCPHP Meetup

NYPHP.org

[nycphp-talk] Uploading file with PHP

Joseph Crawford codebowl at gmail.com
Fri Nov 19 16:38:27 EST 2004


guys i am having a load of an error here and i cannot track it down

i am running php 4.3.8 on linux and apache 2

now i am trying to submit a form with 2 file upload fields on the
form, i have named the fields name="files[]" and in my code when the
form is submitted i print_r both $_FILES and $HTTP_POST_FILES

now here is my problem, they both return an empty array ???

my php.ini says file_uploads is On and the file sizes are not breaking
the 2mb limit set in the php.ini

this is on my dev server so i cannot post a url to a phpinfo page
since my ISP blocks my web server, so what i have done is ran it
locally and saved the source to an html file and posted it on
http://www.codebowl.com/info.html

if anyone can come up with any reasons as to why this would be
happening i would apprectiate it.  I have been fighting with this for
hours.

here is the code after the form is submitted.

if( isset( $_POST['submit'] ) ) {
	echo '<pre>';
	print_r($HTTP_POST_FILES);
	echo '</pre>';
	echo '<pre>';
	print_r($_FILES);
	echo '</pre>';
}

-- 
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com

For a GMail account
contact me OFF-LIST



More information about the talk mailing list