Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

inserting data into BLOB field

339339Oct 8 2003 — edited Apr 16 2007
I have been trying to insert an uploaded file from php script to database blob field , but I am not able to do it.

below is my code, Please help me out with this !!

<?php

include_once("header.inc.php");
include_once("config.php");
include_once("adodb/adodb.inc.php");

$file_name = $_FILES['userfile']['name'];
$uploaddir = "check/". $_FILES['userfile']['name'];
$up = move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir);
chmod($uploaddir,0644);
$folder_name="check";
$doc_file=fread(fopen("$uploaddir","r"),filesize("$uploaddir"));

$app_id=63;
$app_mat_id=1;

$main_query = "INSERT INTO submitted_material_list
(Application_Material_ID,
Application_ID,
Physical_Copy,
Rec_By,
Rec_Date)
VALUES ($app_mat_id,
$app_id,
$doc_file,
$app_id,
SYSDATE)";
$result = $db->Execute($main_query) or die($db->ErrorMsg());
?>

I read online somewhere.. that I can upload it using "LOAD_FILE()" , can it be done with LOAD_FILE() ??

PLEASE HELP !!

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2007
Added on Oct 8 2003
23 comments
26,859 views