php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56593 Can't insert/read binary data
Submitted: 2005-10-12 03:37 UTC Modified: 2006-02-27 07:35 UTC
From: pandrzejczak at mac dot use dot pl Assigned:
Status: No Feedback Package: PDO_SQLITE (PECL)
PHP Version: 5.0.3 OS: MacOSX
Private report: No CVE-ID: None
 [2005-10-12 03:37 UTC] pandrzejczak at mac dot use dot pl
Description:
------------
<form enctype="multipart/form-data" action="display.php?
tryb=1" method="post">
    <input type="hidden" name="MAX_FILE_SIZE" 
value="10000000000000000" />
    Choose a file to upload: <input name="userfile" 
type="file" />
    <input type="submit" value="Upload File" />
</form>

<?php
if ($_GET['tryb']==1) 
{
$fp = fopen($_FILES['userfile']['tmp_name'], 'rb');
echo $_FILES['userfile']['error'];


$pdo = new PDO("sqlite:/sqlite3.sdb");  
$stmt = $pdo->prepare("insert into zdjecia (lp_zdjecia, 
zdjecie, polozenie) values (?, ?, ?)");

$id = 1; // some function to allocate a new ID
$tekst="test";
// assume that we are running as part of a file upload form
// You can find more information in the PHP documentation

$stmt->bindParam(1, $id);
$stmt->bindParam(2, $fp, PDO_PARAM_LOB);
$stmt->bindParam(3, $tekst);
$stmt->execute();


}

?>

Expected result:
----------------
It should insert image into db.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-12 11:47 UTC] wez@php.net
Try a PHP 5.1 snapshot from http://snaps.php.net
 [2006-02-27 07:35 UTC] mike@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC