compiled Posted November 16, 2008 Share Posted November 16, 2008 I need to send binary data from a Windows application to a site. I am used with compiled programming but I don't know much PHP. Is it possible for a PHP script running on a Linux server to receive a package (binary string) of data of random size and store it to disk? Can anybody post a pseudo code (mock-up) PHP program for this so I can use it as starting point? Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/ Share on other sites More sharing options...
Garethp Posted November 16, 2008 Share Posted November 16, 2008 Make the program save as a file and call it up with $Data = fread("Filename"); Or some other method of file reading... Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-691030 Share on other sites More sharing options...
compiled Posted November 16, 2008 Author Share Posted November 16, 2008 Make the program save as a file and call it up with $Data = fread("Filename"); Or some other method of file reading... Hi Garethp I don't understand how a remote Linux server will know to upload a (specific) file from my local hard drive ??? Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-691034 Share on other sites More sharing options...
bobbinsbro Posted November 16, 2008 Share Posted November 16, 2008 try looking into php sockets. Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-691213 Share on other sites More sharing options...
compiled Posted November 17, 2008 Author Share Posted November 17, 2008 I am advancing. However, I need to debug the POST package I send from my windows app. I think it is not properly formated because I get this: [16-Nov-2008 17:22:23] PHP Warning: Missing boundary in multipart/form-data POST data in Unknown on line 0 Where/how can I see the HTTP POST request that my app sends? Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-691759 Share on other sites More sharing options...
bobbinsbro Posted November 17, 2008 Share Posted November 17, 2008 i have no idea but i found a program which may help: http://www.fiddlertool.com/fiddler/ Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-691950 Share on other sites More sharing options...
compiled Posted November 17, 2008 Author Share Posted November 17, 2008 Somebody suggested this code to see the POST but is working only partially: if($_POST){ $str = ''; foreach($_POST as $P=>$p){ $str .= "$P => $p\r\n"; } $str .= "====================\r\n"; $f = fopen('post.txt', 'a+'); fwrite($f, $str); fclose($f); print('POST request saved to disk as post.txt<br>'); } else { print('No POST received!'); } Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-691954 Share on other sites More sharing options...
compiled Posted November 20, 2008 Author Share Posted November 20, 2008 Problem solved. Thank you very much for help. Link to comment https://forums.phpfreaks.com/topic/132891-solved-i-need-to-send-binary-data-from-a-windows-application-to-a-web-site-php-script/#findComment-694786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.