Re: use fopen iso-8859-1 resource

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: use fopen iso-8859-1 resource
Дата
Msg-id CAKFQuwZHigL6TvOOjXmyeXfz9EOdFarh1CHcnekmTwOuERphVA@mail.gmail.com
обсуждение исходный текст
Ответ на use fopen iso-8859-1 resource  (ourdiaspora <ourdiaspora@protonmail.com>)
Список pgsql-general
On Fri, Aug 27, 2021 at 2:59 PM ourdiaspora <ourdiaspora@protonmail.com> wrote:
Please what is the syntax to assign an unknown file name to the 'fopen' function?


There isn't one as it would make no sense - how is it supposed to open a file if there is no filename provided to open?

You have to set things up yourself so that the content you want to open exists in a file at a known location and then pass that location to the function.  In particular, in a web server context, that means taking the request input from the client that represents a file and saving it somewhere first - then opening that saved content.  If the user is supplying a suggested file name for the content you can incorporate that.  You can also ignore it and just make something up.  It doesn't matter (other than concerns about overwriting existing files).  But whatever name you choose to give to the newly created file on the server is the one you pass to fopen.  The name/location of the file on the client machine is irrelevant - the server cannot even see that machine (or, at least should not care even if it technically can) per the fundamental architectural principle of "client-server" design.

David J.

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

Предыдущее
От: ourdiaspora
Дата:
Сообщение: Re: use fopen iso-8859-1 resource
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can we get rid of repeated queries from pg_dump?