Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: deleting a file after loading

by quidity (Pilgrim)
on Nov 28, 2000 at 20:37 UTC ( #43700=note: print w/ replies, xml ) Need Help??


in reply to deleting a file after loading

If you are using GD to make an image, then all you need to do is print the binary data directly to STDOUT when you make it:

#!/usr/bin/perl use GD; # lifted from GD.pm synopsis... $im = new GD::Image(100,100); $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); $im->transparent($white); $im->interlaced('true'); $im->rectangle(0,0,99,99,$black); $im->arc(50,50,95,75,0,360,$blue); $im->fill(50,50,$red); # Important bit: print "Content-type: image/png\n\n"; binmode STDOUT; print $im->png; exit(0);

In the page which must access the image, put a normal img tag, but which src="path to script".


Comment on Re: deleting a file after loading
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://43700]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2015-07-06 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls