Here some example code of sending PDF via HTTP Submit
<br />
<br />// Begin the upload process.
<br />xfa.host.messageBox("This may take over 60 seconds.")
<br />event.target.submitForm({cURL:"http://XX.XX.XX.XX/XMLupload10.php?random="+mcode,cSubmitAs:"XML",cCharset:"utf-8"});
<br />event.target.submitForm({cURL:"http://XX.XX.XX.XX/PDFupload10.php?random="+mcode,cSubmitAs:"PDF",cCharset:"utf-8"});
<br />
<br />Here is an example PHP file that receives it on the other end:
<br />
<br /><?<br /?>
ini_set('max_execution_time', 200);
<br /> require_once("configuration.php");
<br /> $conf=new JConfig();
<br /> $con=mysql_connect($conf->host,$conf->user,$conf->password);
<br /> mysql_select_db('XXXX_XXXX',$con);
<br />
<br /> define('ADMIN_ROOT_DIR',dirname(__FILE__));
<br /> //$xml_uploaddir = ADMIN_ROOT_DIR."/XXXXXX/xml/";
<br /> //$pdf_uploaddir = ADMIN_ROOT_DIR."/XXXXXX/pdf/";
<br /> $xml_uploaddir = substr(ADMIN_ROOT_DIR,0,strrpos(ADMIN_ROOT_DIR,"/"))."/xml/";
<br /> $pdf_uploaddir = substr(ADMIN_ROOT_DIR,0,strrpos(ADMIN_ROOT_DIR,"/"))."/pdf/";
<br />
<br /> function random($length)
<br /> {
<br /> $hash =date('YmdHis',time()+8*3600)."_";
<br /> $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
<br /> $max = strlen($chars) - 1;
<br /> mt_srand((double)microtime() * 1000000);
<br /> for($i = 0; $i < $length; $i++)
<br /> {
<br /> $hash .= $chars[mt_rand(0, $max)];
<br /> }
<br /> return $hash;
<br /> }
<br />
<br /> $file_path = $pdf_uploaddir.random(10).".pdf";
<br /> $temp = split("/",$file_path);
<br /> $pdf_path = $temp[count($temp)-2]."/".$temp[count($temp)-1];
<br />
<br /> $body = file_get_contents("php://input");
<br /> $fp=fopen($file_path,"w");
<br /> fwrite($fp,$body);
<br /> fclose($fp);
<br />
<br /> $random_key = trim($_GET['random']);
<br /> //print_r("Random Number: ".$random_key."
<br />");
<br /> /*
<br /> $xml=simplexml_load_file($file_path);
<br /> $nodes=$xml->xpath("/form1/P1");
<br /> $xml_groupname=$nodes[0]->group_name[0];
<br /> $xml_checkin_date=$xml->DateofArrival;
<br /> $xml_contact_person=$nodes[0]->contact_name[0];
<br /> $xml_contact_email=$nodes[0]->contact_email[0];
<br />
<br /> $sql = "insert into XXX_xml_files (status,file_path,pdf_path,group_name,checkin_date,contact_person,userid,add_time,email) values (0,'$xml_path','','$xml_groupname','$xml_checkin_date','$xml_contact_person',0,now(),'$xml_contact_email')";
<br /> mysql_query($sql);
<br /> mysql_close($con);
<br /> */
<br /> $sql = "select * from XXX_xml_files where r_key='".$random_key."'";
<br /> $result = mysql_query($sql);
<br /> $count = mysql_num_rows($result);
<br /> if($count > 0) {
<br /> $row = mysql_fetch_array($result);
<br /> $sql = "update jos_xml_files set pdf_path='".$pdf_path."' where xid=".$row['xid'];
<br /> mysql_query($sql);
<br /> }
<br /> else {
<br /> $sql = "insert into jos_xml_files (file_path,pdf_path,r_key) values ('','$pdf_path','$random_key')";
<br /> mysql_query($sql);
<br /> }
<br /> mysql_close($con);
<br /> $message = "
<ul class="noindent">
<li>PDF file is uploaded successfully.</li>
<li style="list-style: none">";
<br />?>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></li>
</ul>
<div id="showmsgmain">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<table width="57%" align="center" style="border:1px solid #e5e5e5">
<tr>
<td height="25" bgcolor="#E5E5E5"> Information uploaded!</td>
</tr>
<tr>
<td height="122">
<br />
<div style="margin-left: 2em; color:#0066CC;">
<br /> <?php echo $message;?>
<br />
<br /></div>
<br /></td>
</tr>
</table>
<br /></div>
<br />
<br />