Re: Can postgres saving file ?

Поиск
Список
Период
Сортировка
От Lincoln Yeoh
Тема Re: Can postgres saving file ?
Дата
Msg-id 3.0.5.32.20000519144745.00900c70@pop.mecomb.po.my
обсуждение исходный текст
Ответ на Can postgres saving file ?  (Margaretha Sulistyoningsih <ritha_ok@usa.net>)
Список pgsql-general
At 07:49 AM 19-05-2000 JVT, Margaretha Sulistyoningsih wrote:
>Hi all,
>I need an urgent help. I'm trying to make a Java applet that enable user to
>draw shapes from their browser and save the shapes they made into a file.
>
>My question is : Can Postgres saving file from that applet ?? If yes, how ??

Yes.

Most of the "how" is actually beyond the scope of this list. Most of the
magic is not done by Postgresql. You may have to create your own magic.

The shapes:
If the shapes are made up of vectors then you could use the geometric types
present in Postgresql.

http://www.postgresql.org/docs/postgres/datatype1681.htm

(I'm not sure how you would handle curves. Bezier curves?)

You could also use integers/floats if you want better portability. Then you
could have a table containing object numbers, vectors/curve points with
sequence numbers. You may also wish to link the objects to the relevant
sessions (with ownership, timestamp info).

Possible sequence of events:
Java applet takes user input, stores and displays it. Once user is done,
the user clicks on a "save" button, which submits via HTTP the collated
data to a backend app at the server (could be a CGI program). HTTP is
suggested because it will provide better compatibility with firewalls and
such.

The backend app verifies the sanity and validity of the data, does some
processing and formatting and stores the data into the database, and then
returns a result code to the java applet, which then tells the user what
has happened.

For security reasons the backend app should assume that the data is coming
from an untrusted source.

As you can see in this case a lot of the magic lies in the java applet and
the backend app. For security reasons I would strongly advise you to not
have the java applet connect to the database directly, the applet-backend
(client-server) approach would be safer- you should keep most of the
sensitive stuff in the backend, under your control and away from the applet
(under the remote user's control).

Cheerio,
Link.


В списке pgsql-general по дате отправления:

Предыдущее
От: Dustin Sallings
Дата:
Сообщение: Re: Zip Code Proximity
Следующее
От: M.Mazurek@poznan.multinet.pl
Дата:
Сообщение: Re: Can postgres saving file ?