On Mon, 15 Jul 2002 15:03:45 +0200, [EMAIL PROTECTED] (Konrad Foerstner) wrote:
>Hey folks, > >I would like to have a script which >produces graphics on the fly,b ut there >are some problems: > >- When I write the graphic-file to /tmp/ > I can't open it by writing <img src="/tmp/pic.png"> > in the page the script produces. But the pictures > is verifiable there. > >- So, I tryed an alternativ: Pictures in the /var/www/ > I can open in the page the script produces by > writing <img src="http://localhost/pic.png">. > But here is the problem, that the script can't write the > file to /var/www/ and get a "Permission denied" even > I give everyone the right to write to that folder > (actually I don't like this method because of the > security hole) > >Any solutions? It depends on how you use the image. If it is just generated once, for that page, you can just output the image directly from the cgi by printing it. The GD and ImageMagick modules have methods for printing directly to the browser. Or you can open the picture in your cgi program, and just print it in binary mode to the browser. If you need to keep the picture around for awhile, you will need to figure out the permissions. It is possible to make a 777 directory under your main http directory, just for images, and you should be able to serve the picture from there. Otherwise, post more details of exactly what you need to do with the picture. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]