hopefully there is a simple change (or something overlooked). We ported a PHP application from Redhat 5.9 and PHP 5.4.14 to:
PHP 5.6.33 (cli) (built: Jan 14 2018 08:26:10) Red Hat Enterprise Linux Server release 6.9 (Santiago)
In both cases, it is Apache 2.2.23
We have an API that allows specific applications to send POST data and sometimes files. (We use POSTMAN while testing).
In Postman, if I send a POST request as
form-data (which includes a file) to "somefile.up.php", the very first time I click "Send" in Postman, at the PHP side, if I
print_r on both the $_POST and $_FILES arrays, I can see all of the expected array keys and values, including $_FILES.
If I send another POST request in Postman, with all of the details the same, the $_FILES array is empty (I only see the $_POST vars printed). It would seem the file simply isn't there. The only thing that sometimes works, is select a different file for upload (in Postman) and send the request again, but then that file can only be sent once. Subsequent sends yield an empty $_FILES array.
I've checked the location of where the files get sent to (temporarily) and commonly the value of
/tmp/php... and the [error] value is 0 when the file arrives. I can also see the name and type of the file, along with its size.
I've also checked php.ini values for
upload_max_filesize and post_max_size is larger by 1 M.
We were able to send same file many times when the application was running under PHP 5.4.14 and Redhat 5.9
UPDATE: If I perform the action using shell (babun in this case) I can send the file properly each and every time. So my guess is that something inside Postman is occurring. This, solves my issue by about 50% of the way, only because the script that initially receives the file, has to validate its contents and then perform a Curl post to send it another server. Upon trying that, the file doesn't arrive in the $_FILES array.
UPDATE2: Sending a file from server to server issue solved by updating code. The code was using the very old 'at symbol' in front of the file name in order to get its contents. Updated the code per suggestion forget-the-at-use-curl-file-create . So at this point it's a matter of troubleshooting the Postman Standalone application.