in reply to Do I need a setuid script ?

As other, more experienced, monks pointed out, permissions doesn't seem to be the problem since you actually created the file - something else is wrong. So i'm not going to dwelve into that...

I would, instead, like to question the need for writing the file at all. You might have a very valid reason for actually writing the file to disc, but I would suggest creating the SWF file on the fly when it is requested, if possible. That way you can send the file directly to the browser without having to store it locally.

Without knowing more about the nature of the cgi-script, I cannot tell if it is feasible. If the SWFfile is created from a single argument, like a textstring, I think you should consider this approach.

Replies are listed 'Best First'.
Re: Re: Do I need a setuid script ?
by Anonymous Monk on Dec 10, 2001 at 18:54 UTC
    thanks for the suggestions and sorry if my question was kind of incomplete.. I was all about 'permission problem' cos during development i was getting some error-logs about that and also because of the 'command-line' success'.... Talking about creating the SWF on the fly ...i have to admit i don't even know how to start doing this... Do i print it to the browser?
      The short answer is that, yes, you just print to the browser. You must begin with a correct Content-type-header, then two linefeeds and then you print the SWF data to the browser.

      Something like

      
      print "Content-type: application/x-shockwave-flash\n\n";
      print $SWFdata;
      
      
      would suffice as a really simple SWF-on-the-fly-generation-CGI- script. You get the picture.

      The part where you generate $SWFdata is obviously the non-trivial part, but you seem to have solved that already. If I remember correctly, there is a SWF-creation module that's perhaps worth checking out.