Up for a small challenge question?

Discussion in 'PHP' started by Chris Smith, Mar 27, 2011.

  1. #1
    Hey DPers.
    I have a php script that needs to send binary data to another php script via HTTP.
    The data can be transferred through the methods GET and POST, preferably POST and preferably not as a file.

    The problem is that I have tried a number of ways to do this but every time the data seems to be corrupted. Some bytes stay the same but others disappear or change. I guess that they transfer through ASCII mode instead of BINARY but couldn't find any way to fix this.

    Any help would be deeply appreciated.
    Cheers.
     
    Chris Smith, Mar 27, 2011 IP
  2. dazst

    dazst Active Member

    Messages:
    115
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    78
    #2
    base64_encode() the binary data and post it.
     
    dazst, Mar 27, 2011 IP
  3. Chris Smith

    Chris Smith Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    base64 increases string size by 33%, having to transfer a 133mb file instead of a 100mb file would not be great :p
    Thanks for the reply anyway.
     
    Chris Smith, Mar 27, 2011 IP