pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Bern <sabern@eshell.net>
To: Richie <dugganr@student.cs.ucc.ie>
Cc: pgsql-php@postgresql.org
Subject: Re: Using system call + wrapper?
Date: Mon, 26 Feb 2001 13:25:59 -0600 (CST)
Message-ID: <Pine.LNX.4.30.0102261314040.25509-100000@eshell.net> (raw)
In-Reply-To: <Pine.OSF.3.96.1010226165044.29671A-100000@student.cs.ucc.ie>

I think you've got a lot of good suggestions on how to tackle this
specific issue.  One thing regarding overall design that was briefly
touched on...  You might want to consider having uploading be put into a
staging area that makes no assumptions regarding content, then have a
cron job transfer data over to your productive environment (or
productive directory)... (this was suggested by one of the posts, but
I'm just elaborating on it a bit).  This cron job will add a layer of
abstraction that will provide you with a good bit of flexibility if your
app grows or needs to change at all.  The cron job can then be easily
modified to do certain checks:  is the file valid?  Is it in some way
unreasonable?  Is there space for it in the productive area?  Does the
file already exist?  If so, should it be overwritte?  If I were building
this app, I'd make special effort to seperate content into at least two
camps in the production environment:  content you've written, that's
verified, and content that's in
some way dependant on the user uploading or whatever.  Generally, try to
keep these two as seperate as possible -- even a new directory tree
using symbolic links would be good -- make a /home/usersubmissions or
something to keep this second type of content in, then your /apache tree
is a lot cleaner.  Also, putting your usersubmissions on another
partition (if you've got /usr/local on its own) will prevent /usr/local,
or on Red Hat /var/www from running out of space... if /home runs out of
space, not as big a deal than if some other directories do.

Steve

On Mon, 26
Feb 2001, Richie wrote:

> Hi
>
> I am trying to allow people to save images from their file system to a
> directory on my machine called images, for example the path that I want to
> save to is /usr/local/apache/htdocs/project/images/.
>
> Obviously from above I am using an Apache web server, PHP and PostgreSQL.
> My problem is that you need sudo access to save anything to this
> directory so I get a "Permission denied..." error on the browser. I want
> to save the image to the images directory and save the path to a table in
> my database, however I can do neither in the current situation.
>
> It was suggested to me to use a wrapper that invokes a system call such as
> system('sudo upload.php -p password') that will run the program in sudo
> but I really don't know where to start with this??
>
> Can anyone please help me?
>
> =========================================================
> Richie Duggan
> Computer Science IV
> University College Cork
> Eamil : dugganr@student.cs.ucc.ie   richie_dug@yahoo.com
> Homepage : http://student.cs.ucc.ie/01/dugganr/index.html
>




view thread (7+ messages)

Message-ID: <Pine.LNX.4.30.0102261314040.25509-100000@eshell.net>
Permalink:  ../Pine.LNX.4.30.0102261314040.25509-100000@eshell.net/
Also on:    postgresql.org/message-id/Pine.LNX.4.30.0102261314040.25509-100000@eshell.net

 · 

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: sabern@eshell.net, dugganr@student.cs.ucc.ie
  Subject: Re: Using system call + wrapper?
  In-Reply-To: <Pine.LNX.4.30.0102261314040.25509-100000@eshell.net>
  References: <Pine.OSF.3.96.1010226165044.29671A-100000@student.cs.ucc.ie> <Pine.LNX.4.30.0102261314040.25509-100000@eshell.net>

* 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