From what I read after searching for client.UploadData this function uploads a data buffer to a resource with the specified URI.
This leads me to believe that
sends the data contained in the "UploadImage" variable to the "http://www.myserver.com/" URI.
defaults to http://www.myserver.com/index.html
this would just send data to a process that serves the index.html file. I think that this would not do much at all.
Something better might be
Where loadimage.php can process the data now stored in the imagedata variable.
Another alternative is to replace the PHP script with a CGI script.
The error that you received might indicate that your server is configured to default to index.php instead of index.html is which case you might be sending binary data directly to a PHP script and it is getting confused.