Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

DO NOT REPLY [Bug 14031] New: - POST handling for multi part forms incorrect

From: <bugzilla(at)apache.org>
Date: Mon Oct 28 2002 - 21:48:23 EST


DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14031>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14031

POST handling for multi part forms incorrect

           Summary: POST handling for multi part forms incorrect
           Product: Apache httpd-1.3
           Version: 1.3.27
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Other
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: luke@cramvision.com

I recently upgraded one of my RedHat7.1 servers running apache 1.3.20 to Redhat8.0 running Apache 1.3.26 and then 1.3.27 and I discovered that previously good PHP code no longer worked. The code was simple file upload code for a multi part form with a form element input="file". The POST data just didn't seem to come through to the PHP code. I tried the same thing on a Redhat7.3 box running apache 1.3.26 and then 1.3.27 and I got the same problem. As soon as I put the same code back on version 1.3.20 on another server it worked first time. the following is the code which I used to discover the problem.

<HTML>
<HEAD><TITLE>Store binary data into SQL Database</TITLE></HEAD>
<BODY>

<?php

if ($upload) {

    // connect to the database
    // (you may have to adjust the hostname,username or password)

$db = mysql_connect("192.168.x.x","foo","bar"); mysql_select_db("graphic",$db);

Do you need help?X

@copy("$formdata","./tempfile.jpg");

$size = GetImageSize("./tempfile.jpg");

if ($size[0] < $size[1]){
$dataupright = "1";
}
else {
$dataupright = "0";
}

    $data = addslashes(fread(fopen($formdata, "r"), filesize($formdata)));

    $result=MYSQL_QUERY("INSERT INTO binary_data (bin_data,file_name,file_size,file_type,dataupright) ".

        "VALUES
('$data','$formdata_name','$formdata_size','$formdata_type','$dataupright')");

    $id= mysql_insert_id();
?>
Please use the following tag to use this graphic.<br>
<b>&lt;img src="getpicture.php?id=<?php echo $id?>"&gt;</b><br>
<?

    MYSQL_CLOSE();
} else {
?>

    

File to upload/store in database:


<?php

}
?>
</BODY>
</HTML>


To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org Received on Tue Oct 29 02:47:30 2002
Do you need more help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 16:44:01 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library