POST multipart/form-data temp files not being created. File_upload directive is resetting to "No."

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello php.general:
I want to send a file through an HTML form to my Linux server.

Newbie to PHP, but I have been patient in inverse proportion to my
knowledge.  I have seen many confused people with similar problems and their
respective solutions in my quest (!), but still no avail towards my own.


Here are my questions (first):
What sort of monster could possibly cause ini_get("file_uploads") to return
Off even though php.ini has file_uploads = On?
And how can I slay this monster?


Here is my history (last):
I am running redhat, apache 1.3.23, & PHP 4.3.9.  upload_tmp_dir =
"/var/www/ultmp" and apache runs as user "apache".

I have a form which POSTs a request of multipart/form-data -- specifically a
binary file -- to a php script.  I am using "LiveHTTPHeaders" extension for
FireFox to prove that my browser /is/ in fact composing this request in a
syntactically appropriate idiom.  However, in PHP the $_FILES array comes
out of print_r() as just "array ( )" always, and no file is being sent to
the upload directory.

This is my initial problem, which is a doosie, because it encompases a vast
scope.  BUT I think I've pinned the cause down to something that PHP expert
may be able to help with!


First thought was that the cause was insufficient permissions for the
"apache" user:
I chmod'ed the directory /var/www/ultmp to 777 and chown'ed it to apache.  I
am assuming that the temp directory does not have to be (and really should
not be) a world-readable.  I was able to determine that the cause /is not/ a
problem with the permissions of the user "apache" by adding into my PHP a
call to mkdir() which creates a directory off of the directory in my
"upload_tmp_dir" directive.  (And verified that the directory does in fact
begin to exist following the script's execution.)


Second thought was that the cause was with php.ini or http.conf.
I have checked apache error_log: nothing.  I tried setting upload_tmp_dir to
(nothing), to "/var/www/ultmp/", and to "/var/www/ultmp"; still nothing.  I
must admit that I still have not completely determined the cause to be
not-apache, but I have no leads except this one in PHP, and my searches of
http.conf yeild no tangible results.

I am using a wonderful script [http://www.epiware.com/scripts/upload.php] to
troubleshoot my uploading woes.  I am unable to upload small and large files
alike.

In my php.ini file, I have the following directives/values
 file_uploads = On
 upload_tmp_dir = "/var/www/ultmp"
 upload_max_file_size = 2M
 max_execution_time = 30
 post_max_size = 2M


But the spark in my curiousity: when I do phpinfo() in my
post-action-script, I see for the file_upload directive the "Local Value"
goes to Off.  My guess is that what ever is causing "Local Value" to go to
Off even though "Master Value" is On (I did try restarting the server) is
also causing my $_FILES variable to be empty and my actual file data to be
thrown into the trash.




If you read all the way to the bottom, I must thank you for your time!
My respect and admiration to the PHP community!

cudos,
Shawn Kelly.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux