简体   繁体   中英

saving blob file in oracle using php

please tell me how can i insert pdf or doc files into oracle blob field .

this is the code which i use for varchr data type and this is fine but how can i save the files into blob data type please help me !!!

if(isset($_POST['elm1'])) {

$pdata=$_POST['elm1'];  
$profile_name=$_POST['profilename'];
$profile_id=$_POST['profileid'];
$query = "insert into prepaid_profiles values('$profile_id' , '$profile_name','$pdata')";
$result = oci_parse($dbc,$query);
oci_execute($result);
oci_close($dbc);

When user uploads file, save it in server, show only link to it. When saved text from editor, you save only link (with rest of text). File is still on server.

But if you really need to make your database huge and slowly, read uploaded file with file_get_contents , that convert it to base64 and save to database long string (no idea why it's better).

TinyMCE don't need file content in <textarea> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM