pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Papp Gyozo <pgerzson@freestart.hu>
To: Chris Smith <csmith@squiz.net>
To: Zhidian Du <duzhidian@hotmail.com>
To: pgsql-php@postgresql.org
Subject: Re: Are these steps correct and standard way to upload
Date: Tue, 12 Nov 2002 00:38:56 +0100
Message-ID: <E18BXbd-0003Lp-00@relay.freestart.hu> (raw)
In-Reply-To: <5.1.0.14.0.20021108154207.03192b70@cooee.squiz.net>
References: <5.1.0.14.0.20021108154207.03192b70@cooee.squiz.net>

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




view thread (3+ messages)

Message-ID: <E18BXbd-0003Lp-00@relay.freestart.hu>
Permalink:  ../E18BXbd-0003Lp-00@relay.freestart.hu/
Also on:    postgresql.org/message-id/E18BXbd-0003Lp-00@relay.freestart.hu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: pgerzson@freestart.hu, csmith@squiz.net, duzhidian@hotmail.com
  Subject: Re: Are these steps correct and standard way to upload
  In-Reply-To: <E18BXbd-0003Lp-00@relay.freestart.hu>
  References: <5.1.0.14.0.20021108154207.03192b70@cooee.squiz.net> <E18BXbd-0003Lp-00@relay.freestart.hu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox