1$filename = "/path/to/uploaded/file.zip";
2$file_contents = file_get_contents($filename);
3
4$content = "--".MULTIPART_BOUNDARY."\r\n".
5 "Content-Disposition: form-data; name=\"".FORM_FIELD."\"; filename=\"".basename($filename)."\"\r\n".
6 "Content-Type: application/zip\r\n\r\n".
7 $file_contents."\r\n";
8
9// add some POST fields to the request too: $_POST['foo'] = 'bar'
10$content .= "--".MULTIPART_BOUNDARY."\r\n".
11 "Content-Disposition: form-data; name=\"foo\"\r\n\r\n".
12 "bar\r\n";
13
14// signal end of request (note the trailing "--")
15$content .= "--".MULTIPART_BOUNDARY."--\r\n";
1$header = 'Content-Type: multipart/form-data; boundary='.MULTIPART_BOUNDARY;