chris.smith Posted March 27, 2011 Share Posted March 27, 2011 Hey guys. Sorry to start asking questions being such a new member but this just suddenly came up. 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. Quote Link to comment Share on other sites More sharing options...
nethnet Posted March 27, 2011 Share Posted March 27, 2011 If it is a small amount of binary data, you could use base64_encode and send it via GET. Quote Link to comment Share on other sites More sharing options...
chris.smith Posted March 27, 2011 Author Share Posted March 27, 2011 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 Quote Link to comment Share on other sites More sharing options...
nethnet Posted March 27, 2011 Share Posted March 27, 2011 So what is the hesitation with sending them as files? Quote Link to comment Share on other sites More sharing options...
chris.smith Posted March 27, 2011 Author Share Posted March 27, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.