Good day!

I set up integration with 1C and the following problem arose:

I am processing a zip file with 1C. I have to read the file from him to process and give an answer.

$zip = new ZipArchive(); $zip_status = $zip->open(file_get_contents('php://input')); 

In php: // input comes say file.

But when I try to open it with $zip->open then it returns false, ie it could not be opened.

Maybe I somehow do not process the receipt of the archive? Who will tell you how to do it right?

PSYS: When the xml file_get_contents('php://input') file came to file_get_contents('php://input') worked as it should and received the contents of the file.

  • ph: // input is a stream, well, the post request can be limited by the size - Naumov
  • The archive weighs several kilobytes. I say a mistake when he tries to open it. Perhaps not correctly transmit or accept the archive. Perhaps you need something special to take it. - Vladimir Mikhailov
  • php.net/manual/ru/ziparchive.open.php so look in the mang 1st parameter the path and not the content try this $zip->open('php://input') - Naumov
  • And so also tried. Also the same mistake opening. - Vladimir Mikhailov
  • $zip->open seems to return an error code to indicate which kind of error - Bookin

0