Can someone please show me a WORKING code to upload a file into Oracle? I have searched out several from Google, but no one really works. Please help!
----------One of the samples that doesn't work-------------
<html><head><body>
<?php
if(!isset($userfile_name) || $userfile_name == 'none'){
?>
<form action="<? echo basename($PHP_SELF)?>" method="post" enctype="multipart/form-data">
<p>Upload file: <input type="file" name="userfile"></p>
<P><input type="submit" value="Upload"> <input type="reset"></p>
</form>
<?php
} else {
$conn = OCILogon("scott", "tiger", "Daluko");
$fd = fopen( $userfile_name, "r" );
$contents = fread( $fd, $userfile_size);
fclose( $fd );
$blob = OCINewDescriptor($conn, OCI_D_LO😎;
$query = "INSERT INTO blobtest VALUES (blob_id_seq.nextval, EMPTY_CLOB()) RETURNING blobcol INTO :the_blob";
$stmt = OCIParse($conn, $query);
OCIBindByName($stmt, ":the_blob", &$blob, -1, OCI_B_BLO😎;
OCIExecute($stmt, OCI_DEFAULT);
$blob->save($contents);
OCICommit($conn);
//OCIFreeDescriptor($blob);
OCIFreeStatement($stmt);
}
?>
</body></html>