RE: Upload file problem
| From: | Nold, Mark | Date: | Tue, 19 Dec 2000 05:14:12 +0000 |
| Subject: | RE: Upload file problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-5334@lists.php.net to get a copy of this message | ||
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
Sorry this is not an answer to your question but why would you want to do
this? Why not save the file somewhere in your filesystem and just store the
details including the path to the file itself in your DB. Why get stuck
using Oracle LOB's when you only need a text field to say where the file is?
Or you could even change the file name to match some sort of id and store
the real name in the DB.
Mark Nold
markn@enspace.com <mailto:markn@enspace.com>
Senior Consultant
Change is inevitable, except from vending machines.
-----Original Message-----
From: Kevin Leier [mailto:kleier@btigate.com]
Sent: Tuesday, December 19, 2000 4:35 AM
To: Php-General; Php-Db
Subject: Upload file problem
I am having problems uploading files from a web form and saving them in a
LOB field in Oracle 8i (8.1.6). I am using PHP v4.03pl1 and have tried on
both NT 4 and Solaris 8 using Apache web server. Everything works fine for
files under about 4MB, but anything larger gets the following error:
"Warning: OCILobWrite: ORA-27052: unable to flush file data SVR4 Error: 11:
Resource temporarily unavailable Additional information: 3 in
/uploadpage.php on line X"
I have tried adjusting the following items in the php.ini with no effect:
max_execution_time
memory_limit
post_max_size
upload_max_filesize
Here is the code for the page:
==============================================
$sql = "INSERT INTO storage(id,content) ";
$sql .= " VALUES (id_seq.NEXTVAL,EMPTY_BLOB())";
$sql .= " RETURNING content INTO :content";
$lob = OCINewDescriptor($db->conn,OCI_D_LOB);
$stmt = OCIParse($db->conn, $sql);
OCIBindByName($stmt, ':content', &$lob, -1, OCI_B_BLOB);
OCIExecute($stmt, OCI_DEFAULT);
if ($lob->savefile($upfile))
{
OCICommit($db->conn);
}
else
{
$msg = "Failure!";
}
==============================================
Any ideas?
Thanks in advance.