<?php $lob_upload = $_FILES['lob_upload']; if (!isset($lob_upload) || $lob_upload == 'none'){ ?> <?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 = "//192.168.1.9/finaltest"; $db_user = "root"; $db_pass = "localhost!@#"; $conn = oci_connect($db_user, $db_pass,$db_host); $lob = oci_new_descriptor($conn, OCI_D_LOB); $table = 'dutbin'; $stmt = oci_parse($conn, "INSERT INTO dutbin (CustomerLotID ,State ,Hifix ,Pgm ,/"Pgm version/" ,Device ,Tester ,/"Date/" ,StartTime ,Bin) VALUES ('$customerid', '$state', '$hifix', '$pgm', '$pgm_version', '$device', '$tester', '$date', '$time', EMPTY_BLOB()) returning Bin into :the_blob"); oci_bind_by_name($stmt, ':Bin, $lob, -1, OCI_B_BLOB); oci_execute($stmt, OCI_DEFAULT); if ($lob->saveFile($lob_upload['tmp_name'])){ oci_commit($conn); echo "Blob successfully saved/n"; }else{ echo "Couldn't saved Blob/n"; } oci_free_descriptor($lob); oci_free_statement($stmt); oci_close($conn); } ?> 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/hxw001/archive/2009/05/22/4208747.aspx