Search Postgresql Archives

Re: use fopen unknown resource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 27, 2021 at 2:59 PM ourdiaspora <ourdiaspora@xxxxxxxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux