Jump to content

[SOLVED] I need to send binary data from a Windows application to a web site (php script)


compiled

Recommended Posts

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.

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  ???

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?

 

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!'); }

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.