Sponsored Content
Top Forums Shell Programming and Scripting cgi script to print all .png files on a single page Post 302427539 by pludi on Monday 7th of June 2010 02:35:07 AM
Old 06-07-2010
Randomly changing settings without knowing what they're doing seldom solves a problem (even if it's a nice learning experience).

Change back the httpd.conf settings. The Directory directive needs a real path as an argument, not an Alias.

The Forbidden message came up because Apache, by default, does not allow directory indexing as a security measure. That does not mean that you can't access the files inside, it only means you'll have to know the exact name.

And your script does exactly what you told it to (which isn't necessarily what you wanted). It takes the name of an image as an argument, and displays said image. So you'd have to call it as http://mywebserver/pass.cgi?image=test.png it would display the image "test.png" from the directory /var/www/html/rrdtool/
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

CGI passing arrays/hashes to another CGI script

If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link? Hope that makes sense! :) (2 Replies)
Discussion started by: WIntellect
2 Replies

2. Shell Programming and Scripting

CGI: refresh page and timeout

Hi, I've been able to put together an HTML page that calls on a cgi program (via ksh) to do some server side processing, then send it back to the user's browser window. The script basically tails a log file and refreshes every # seconds (user chosen) by using the "refresh" meta tag (html). My... (0 Replies)
Discussion started by: man
0 Replies

3. Shell Programming and Scripting

lpr- how to print from page to page

hi all i have file_1 which contains 66 pages and i want to print only page 1 to 3 i try to write like this lp -d name_of_printer file_1 -P 1-7 this command does not work any ideas ? (4 Replies)
Discussion started by: naamas03
4 Replies

4. Shell Programming and Scripting

How to pass data from server (CGI script) to client (html page)

Hi I know how to pass data from client side (html file) to server using CGI script (POST method). I also know how to re-create the html page from server side after receiving the data (using printf). However I want to write static pages on client side (only the structure), and only to pass... (0 Replies)
Discussion started by: naamabm
0 Replies

5. Shell Programming and Scripting

Delete Files with CGI Bash Script

Hi. I could use some help with my problem. I am creating a website. One option on this website is to delete a specified file, say an image, when the user clicks on it. I want to do this with CGI. I believe bash will be the easiest since I will just type the command "rm file". I also do not know... (4 Replies)
Discussion started by: JMooney5115
4 Replies

6. Shell Programming and Scripting

Print multiple copies page by page using lp command

Hi I have a pdf file that is being generated using the rwrun command in the shell script. I then have the lp command in the shell script to print the same pdf file. Suppose there are 4 pages in the pdf file , I need to print 2 copies of the first page, 2 copies of the second page , then 2... (7 Replies)
Discussion started by: megha2525
7 Replies

7. Web Development

CGI not working with httpd server on busybox 1.15.0 on ltib Linux 2.6.34 (404 page not found)

I have some industrial ARM linux board with 2.6.34 Linux on it with Busybox v1.15.0. The https.conf is located in /etc/ and contains: H:/root/web In the www directory I also have 'cgi-bin' folder with chmod 777 and in that folder a file called 'testcgi'. Now I start the server with... (1 Reply)
Discussion started by: Roboserg
1 Replies

8. Windows & DOS: Issues & Discussions

Super Simple Script to remove first characters of any png file

Well I searched the net with varying success, but it seems kinda hard to find a one/max 2 lined command to: strip all *.png files in the folder from their first two characters. Any help is appreciated. In DOS commandline of course... (17 Replies)
Discussion started by: pasc
17 Replies

9. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies
IMAGEPNG(3)								 1							       IMAGEPNG(3)

imagepng - Output a PNG image to either the browser or a file

SYNOPSIS
bool imagepng (resource $image, [string $filename], [int $quality], [int $filters]) DESCRIPTION
Outputs or saves a PNG image from the given $image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $filename -The path to save the file to. If not set or NULL, the raw image stream will be outputted directly. Note NULL is invalid if the $quality and $filters arguments are not used. o $quality - Compression level: from 0 (no compression) to 9. o $filters - Allows reducing the PNG file size. It is a bitmask field which may be set to any combination of the PNG_FILTER_XXX constants. PNG_NO_FILTER or PNG_ALL_FILTERS may also be used to respectively disable or activate all filters. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+--------------------------------+ |Version | | | | | | | Description | | | | +--------+--------------------------------+ | 5.1.3 | | | | | | | Added the $filters parameter. | | | | | 5.1.2 | | | | | | | Added the $quality parameter. | | | | +--------+--------------------------------+ EXAMPLES
<?php $im = imagecreatefrompng("test.png"); header('Content-Type: image/png'); imagepng($im); imagedestroy($im); ?> SEE ALSO
imagegif(3), imagewbmp(3), imagejpeg(3), imagetypes(3), imagesavealpha(3). PHP Documentation Group IMAGEPNG(3)
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy