php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5609 unable to store BLOBs in database
Submitted: 2000-07-14 14:03 UTC Modified: 2006-07-17 08:40 UTC
From: ernst at benews dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0 Patch Level 2 OS: RedHat Linux 6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ernst at benews dot com
New email:
PHP Version: OS:

 

 [2000-07-14 14:03 UTC] ernst at benews dot com
The problem occurs with the following script. It's a slightly modified version of that in the docs:

<?php
if(!isset($lob_upload) || $lob_upload == 'none'){
?>
<form action="upform.php" method="post" enctype="multipart/form-data">
Upload file: <input type="file" name="lob_upload"><br>
<input type="submit" value="Upload"> - <input type="reset">
</form>
<?php
} else {
	// $lob_upload contains the temporary filename of the uploaded file
     OCIInternalDebug(1);
     $conn = OCILogon("user", "pass");
     $lob = OCINewDescriptor($conn, OCI_D_LOB);
     $stmt = OCIParse($conn,"INSERT INTO tblPersonInfo (PersonID, Picture) VALUES(4, EMPTY_BLOB()) RETURNING Picture INTO :banaan");
     OCIBindByName($stmt, ':banaan', &$lob, -1, OCI_B_BLOB);
     OCIExecute($stmt, OCI_DEFAULT);
     if($lob->savefile($lob_upload)) {
        OCICommit($conn);
        echo "Blob successfully uploaded\n";
     }else{
        echo "Couldn't upload Blob\n";
     }
     OCIFreeDesc($lob);
     OCIFreeStatement($stmt);
     OCILogoff($conn);
  }
?>

The problem is that the blob never gets stored, and the script times out after a long time (2 minutes+). During that period, no output whatsoever is sent to the browser. Also, the debugging info generated by OCAInternalDebug() doesn't show up in apaches error.log.

When I comment out the OCIExecute statement, the script does return with output, although the data never gets stored in the db (of course). 

Here's a description of the system configuration:

webserver:
redhat linux 6.2
apache + openssl + php4pl2
oracle client 8.1.5

db server
hpux
oracle 8.0.5

The connection to the database is working fine. 'Normal' inserts also work fine.

Any tips are appreciated.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-04 20:46 UTC] sniper@php.net
Does this problem still exist with php4.0.2 ?

--Jani
 [2000-10-02 22:51 UTC] sniper@php.net
No feedback.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC