Date: 08/31/99
- Next message: Wico de Leeuw: "Re: [PHP-DEV] PHP 4.0 Bug #2189: mysql_free_result doesn't free memmory"
- Previous message: chopin <email protected>: "[PHP-DEV] PHP 4.0 Bug #2199: segmentation fault when fopen( $url) for specific $url address"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
kara Tue Aug 31 04:32:20 1999 EDT
Modified files:
/phpdoc/functions oci8.sgml
Log:
Corrections to OCINewDescriptor
Index: phpdoc/functions/oci8.sgml
diff -u phpdoc/functions/oci8.sgml:1.7 phpdoc/functions/oci8.sgml:1.8
--- phpdoc/functions/oci8.sgml:1.7 Wed Aug 4 19:34:02 1999
+++ phpdoc/functions/oci8.sgml Tue Aug 31 04:32:19 1999
@@ -532,6 +532,8 @@
<para>
<function>OCINewDescriptor</function> Allocates storage to hold descriptors or LOB locators.
Valid values for the valid <parameter>type</parameter> are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID.
+ For LOB desriptors, the methods load, save, and savefile are associated with the descriptor,
+ for BFILE only the load method exists. See the second example usage hints.
</para>
<example>
@@ -564,6 +566,39 @@
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
+ </programlisting><programlisting>
+<?php
+ /* This script demonstrates file upload to LOB columns
+ * The formfield used for this example looks like this
+ * <form action="upload.php3" method="post" enctype="multipart/form-data">
+ * <input type="file" name="lob_upload">
+ * ...
+ */
+ if(!isset($lob_upload) || $lob_upload == 'none'){
+?>
+<form action="upload.php3" method="post" enctype="multipart/form-data">
+Upload file: <input type="file" name="lob_upload"><br>
+<input type="submit" value="Upload"> - <input type="reset">
+</form>
+<?php
+ } else {
+ // $lob_upload contains the temporary filename of the uploaded file
+ $conn = OCILogon($user, $password);
+ $lob = OCINewDescriptor($conn, OCI_D_LOB);
+ $stmt = OCIParse($conn,"insert into $table (id, the_blob) values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob");
+ OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
+ OCIExecute($stmt);
+ if($lob->savefile($lob_upload)){
+ OCICommit($conn);
+ echo "Blob successfully uploaded\n";
+ }else{
+ echo "Couldn't upload Blob\n";
+ }
+ OCIFreeDescriptor($lob);
+ OCIFreeStatement($stmt);
+ OCILogoff($conn);
+ }
+?>
</programlisting></example>
</refsect1>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Wico de Leeuw: "Re: [PHP-DEV] PHP 4.0 Bug #2189: mysql_free_result doesn't free memmory"
- Previous message: chopin <email protected>: "[PHP-DEV] PHP 4.0 Bug #2199: segmentation fault when fopen( $url) for specific $url address"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

