Re: Are these steps correct and standard way to upload - Mailing list pgsql-php

From Papp Gyozo
Subject Re: Are these steps correct and standard way to upload
Date
Msg-id E18BXbd-0003Lp-00@relay.freestart.hu
Whole thread Raw
In response to Re: Are these steps correct and standard way to upload  (Chris Smith <csmith@squiz.net>)
List pgsql-php
2002. november 8. 05:45 dátummal Chris Smith ezt írta:
| Hi,
|
| >I check the posts about uploading images from browser.  No one give
| > me a whole procedure how to do it.  My friend told me I can upload
| > binary/image file using following steps:
| >
| >         exec("cp $pic $File");
|
| Use the move_uploaded_image function in PHP. Safer and easier.

The proper name of the function mentioned here is move_uploaded_file().
See: http://php.net/move_uploaded_file


Snippet from the PHP Manual on how to writing BLOBs into PostgreSQL
databases:

<?php
    $database = pg_connect ("dbname=jacarta");
    pg_query ($database, "begin");
    $oid = pg_lo_create ($database);
    echo "$oid\n";
    $handle = pg_lo_open ($database, $oid, "w");
    echo "$handle\n";
    pg_lo_write ($handle, "large object data");
    pg_lo_close ($handle);
    pg_query ($database, "commit");
?>

--
Papp, Győző
- pgerzson@freestart.hu


pgsql-php by date:

Previous
From: Kevin Gordon
Date:
Subject: Compiling Postgresql --with-unixodbc
Next
From: Tom Lane
Date:
Subject: Re: [SQL] Parent table has not oid?