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
https://forums.phpfreaks.com/topic/231862-up-for-a-small-challenge-question/
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 ;)

So what is the hesitation with sending them as files?

 

Perhaps I made a mistake when I tried to distinguish between files and messages.

The truth is that files and messages are combined with some other strings and then encrypted using AES-256.

 

Cheers.

Archived

This topic is now archived and is closed to further replies.

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