I'm trying to post image files to a php script with another php script.
Don't ask why, it's a crazy project :)
Now the file is around 28000 bytes but the post receiver only gets
300 bytes. Has anybody experienced this behaviour?

I use the following script:

--- snap ---
// the receiver of file 
$remote_page = "http://www.server.com/post.php";; 

// the file to upload
$file = "/var/www/test/dummy.jpg"; // the file location 
$con_type = "image/jpg"; // the file mime type 
$content_file = join("",file($file)); 

// define boundary 
$boundary =
$data = "--$boundary 
Content-Disposition: form-data; name=\"userfile\"; filename=\"$file\" 
Content-Type: $con_type 

$msg = 
"POST $remote_page HTTP/1.0 
Content-Type: multipart/form-data; boundary=$boundary 
Content-Length: ".strlen($data)."\r\n\r\n"; 

$f = fsockopen("www.server.com",80); 
$result = fread($f,32000); 
print $result."\n<br>"; 

--- snap --

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to