writing files on HD vs overwriting files on Apache CGI

jbv jbv.silences at club-internet.fr
Wed Feb 19 16:25:01 EST 2003


Hi folks,

When using the following script in a regular MC stack :

    open file myFile
    write myVar to myFile
    close file myFile

MC overwrites an already existing file, or creates a new
file with that name on the HD.

But when MC is used as CGI on Apache for instance,
no new file is created. The only way to achieve this, is
to place in the right directory a file of same name & type,
(and full access privilege : 777) and overwrite it with the script.

For instance, I have a web page with a form allowing users to
upload jpg & gif files of their own. The cgi script parses these
files and is supposed to store them in a specific directory with
specific names. In order to achieve this, I need to put in advance
in that directory as many empty files as possible uploads, with
the right names. Then when a file is uploaded, the content will
overwrite the corresponding file.

Could some CGI / Apache / Unix guru be kind enough to explain
why this is so ?

Thanks,
JB





More information about the metacard mailing list