Jump to content

cpordoegr

Members
  • Posts

    4
  • Joined

  • Last visited

cpordoegr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes i included all headers. Actually now i can identify the type of the response content on receiving side. However i want to do the following Step 1. Create a new empty zip file Step 2. Write the received response body (a zip file with mutliple files in it) to this zip file. Step 1 is ok. But i am not sure how should i implement Step 2. I used "fwrite($zipfile, gzcompress($response_body));" but it is not working. Afterwards when i try to open this zip file with a zip software i get invalid zip file message. Thanks.
  2. One more question about your suggested code. Will it be possible to identify the type of the file on client side (the one who will receive this zip file as a response)?
  3. Thanks for quick response. I find that the code you provided is working. However, the client, after receiving this zip file shows the contents of the file in browser (firefox e.g.), can we enfore it to be opened with a zip software (or ask for saving it)?
  4. Hi, I need some help in sending files as a response to a POST request. I have written a PHP RESt API which is already receiving files with POST requests, however i want to send back a zip file(or multiple files) in response to this request. Any help in this regard? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.