Re: Storing Documents

Поиск
Список
Период
Сортировка
Искать
От
Mitch Pirtle
Тема
Re: Storing Documents
Дата
Msg-id
330532b6050309113610febe1f@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Storing Documents <operationsengineer1@yahoo.com>
Re: Storing Documents Mitch Pirtle <mitch.pirtle@gmail.com>
Re: Storing Documents John DeSoi <desoi@pgedit.com>
Hey operationsengineer1,

On Wed, 9 Mar 2005 09:39:03 -0800 (PST), operationsengineer1@yahoo.com
 wrote:
> 
> is this the best way?  is there a hidden *gotcha*
> involved that i might need to be aware of?

Here is a trick I have learned over the years:

Step 1:
CREATE TABLE filebase (
  id serial NOT NULL PRIMARY KEY,
  filename varchar(128) NOT NULL
)

Step 2:
Have your scripts save the uploaded file as /usr/share/filebase/(id)

Step 3:
Always reference your 'filename' throughout application. That way you
don't have to worry about duplicate filenames overwriting each other
(unpleasant)... If you wanted simple version control, you could also
create a second table that stored versions for each row in the
filebase table.

-- Mitch

-- Mitch
В списке pgsql-novice по дате отправления
От: Sean Davis
Дата:
От: Kumar S
Дата:
FAQ