|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-08-04 11:33 UTC] stas@php.net
[2000-08-07 07:59 UTC] thies@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Instead of using $lob->savefile($form_data) for storing lob into oracle8 db, like is described in the php manual seccion oracle8 functions. Use $lob->save(readf($form_data)) becaus function savefile doesn't store the whole lob in the orcale8 db just a part of it. Here?s a short script for storing lob into oracle8 db $sql = "insert into fotos (id, dados, largura, altura, formato,tamanho)"; $sql .= " values ($id, EMPTY_BLOB(), $largura, $altura, '$formato', $form_data_size)"; $stmt = OCIParse($conn,"$sql returning dados into :lob"); $lob = OCINewDescriptor($conn,OCI_D_LOB); OCIBindByName($stmt,":lob",$lob,-1,OCI_B_BLOB); OCIExecute($stmt,OCI_DEFAULT); if($lob->save(readf($form_data))){ OCICommit($conn); echo "Blob successfully uploaded\n"; } else { echo "Couldn't upload Blob\n"; } Where readf is a function for reading binary data function readf($filename) {$fp = fopen($filename,"rb"); $buffer = fread($fp,filesize($filename)); fclose($fp); return $buffer; } Another thing try to look at the function writetofile and fwrite a see the difrences when saving a lob into a file. When using writetofile the carriage return (0A) is converted to (0D 0A) under win98.