Jump to content

Up for a small challenge question?


chris.smith

Recommended Posts

Hey guys.

Sorry to start asking questions being such a new member but this just suddenly came up.  :P

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.

Link to comment
Share on other sites

If it is a small amount of binary data, you could use base64_encode and send it via GET.

 

Indeed I am aware of that, the problem is that the amount of data transferred is rather variable.

Due to the nature of the entry script, the data can be a few bytes big for a message or a few megabytes big for an attachment.

For the later case, it is much easier to transfer a 100mb file rather than a 133mb one. And these all exclude the time needed to encode the files and strings ;)

 

Thanks for the reply anyway ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.