0
votes

I'm receiving a Zip file encoded to Base64 on a JSON Callback How can I save that as a Zip file? I know how I can base64_decode that but I'm having an hard time saving that as a normal Zip file. I'm working with PHP

Thank you for your help!

EDIT

It is solved. I just need to base64_decode the string and save it as a temp.zip file and then extract the content from that temp file. What I was trying to do was extract the content directly from the base64_decoded string which I guess it's not possible.

1
If it was already a zip file before it was base64 encoded, then just base64_decode it and thats the zip file, so save that to disk as xxx.zip - RiggsFolly
What exactly gives you a "hard time"? What problems/errors do you get? Base64 doesn't care for the content. After decoding it's just binary data that you write to a file. - jps
I'm sorry, but sometimes we just make a big storm inside a small glass. I was trying to do something I don't need to. Yes, it was already a zip file before and I just need to save it as a simple zip file after I base64_decode it. Thank you! - danielfos
@Zachary the OP already receives a b64 encoded zip file, there's no need to zip the data again. - jps

1 Answers

0
votes

SOLVED It is solved. I just need to base64_decode the string and save it as a temp.zip file and then extract the content from that temp file. What I was trying to do was extract the content directly from the base64_decoded string which I guess it's not possible.