-
<?php
-
-
$lob_upload
= $_FILES['lob_upload']; -
if
(!isset( $lob_upload)|| $lob_upload== 'none'){ -
?>
-
<form
method="post" enctype= "multipart/form-data"> -
Upload
file: <input type="file" name= "lob_upload"/><br /> -
<input
type="submit" value= "Upload"/> "reset"- <input type= value= "Reset"/> -
</form>
-
<?php
-
} else { -
-
// $lob_upload contains the temporary filename of the uploaded file -
// see also the features section on file upload, -
// if you would like to use secure uploads -
ini_set('display_errors',1); -
$db_host = -
$db_user = -
$db_pass = -
$conn = $db_user,oci_connect( $db_pass,$db_host); -
$lob = $conn,oci_new_descriptor( OCI_D_LOB); -
$table = 'PICTURES'; -
$stmt = $conn,oci_parse( "insert $tableinto (id, the_blob) -
values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob"); -
-
oci_bind_by_name($stmt, ':the_blob', $lob, -1, OCI_B_BLOB); -
oci_execute($stmt, OCI_DEFAULT); -
if ( $lob->saveFile($lob_upload['tmp_name'])){ -
oci_commit($conn); -
echo "Blob successfully ;uploaded/n" -
}else{ -
echo "Couldn't upload ;Blob/n" -
} -
oci_free_descriptor($lob); -
oci_free_statement($stmt); -
oci_close($conn); -
} -
?>
前一篇:php获取文件后缀名
后一篇:替换字符串
< 前一篇php获取文件后缀名
后一篇 >替换字符串