Dear RedHat, as far as I can tell this is where I'm supposed to send this information. On the new PHP RPM, php-4.0.4pl1-3.i386.rpm the file upload support appears to be broken. However, furthur investigation reveals that uploads seem to be processed differently in PHP 4.0.4 (at least with this RPM). No longer does the data from the uploaded file come in as a string. This breaks the upload support that worked with previous RPMs. The new implementation of PHP puts all data for an uploaded file in as a file only (in RH 7.0 as a file in /tmp), this file is then destroyed when the PHP script terminates. While this seems to be a wise memory managment decision, it is something that isn't clearly documented anywhere, including the PHP site. In fact, the example of files uploads on the PHP site does not work with the new RPM. If you guys would like to see the code I had to write to get file uploads to work with your new RPM, please give me an e-mail address to send code to, or if it's more convienient I'll post it to our company website. If I sent this information to the wrong place, I apologize. If I, or we (Digital Indigo) can assist you anyway, please feel free to contact me. RedHat has offered excellent distributions and support to us, and we'd be more than glad to help you out if at all possible. Sincerely, Mike Fiorill
Created attachment 8368 [details] Code to receive a file from a form with file upload (and put into MySQL)
We're getting a number of reports about both 3.0.18 and 4.0.4pl1.
Upon upgrading to RedHat 7.2 it appeared as though posting files to a PHP script was broken. This was not the case, however. All scripts which appeared to have broken scripts had one thing in common... They did not have the following text in the form tag: enctype="multipart/form-data" To fix any post bugs where files are not acceppted by the PHP script your form tag should look something like this: <form action=/sys-php/iformmail.php method=post enctype="multipart/form-data">