Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: deleting a file after loading

by cephas (Pilgrim)
on Nov 28, 2000 at 21:01 UTC ( [id://43704]=note: print w/replies, xml ) Need Help??


in reply to deleting a file after loading

Are you trying to spit out the image data straight onto the html page along with the html content? If so that would explain the problem of having the ASCII data showing up. What should work is if you generate your dynamic html, and then have an image tag that looks like:

<image src="/cgi-bin/imagegenerator.cgi">


What should be happening is, the browser will make a request to your html generating cgi, then it will start making separate requests for each image it needs, and call your image generating cgi.....

cephas

Replies are listed 'Best First'.
Re: Re: deleting a file after loading
by belize (Deacon) on Nov 28, 2000 at 21:13 UTC
    This is the exact problem I am having. But then, the image being generated is based on a search of a database, so that if I reference an external CGI, I have to pass the results of the search, and this I am having trouble doing.

    So, I decided to use a subroutine to generate a file, display the file, then delete the file.

    Part of my program does call the remote CGI when a single record is returned and it is easy to pass the variables for a single image to be drawn.

    If you go to http://www.belizeexplorer.com right now, click on search, and choose Mayan Sites in the Category box, you will see the ASCII come back. Then if you click on the individual links, you will see the program work when it draws a single record.

    I think I will have to go back to creating an image, then deleting them after a period of time.

    Thanks for your post.

    Tony

      What if your search assigned an ID number to each visitor, and you used that ID number with a CGI image generation script to either pull their search terms, or simply retrieve a pre-built image associated with that ID?
      # in the parent CGI script my $id = get_user_id; # just give them a new ID build_image($id, @arguments); # or store the arguments # in a database or something print "<img src='/cgi-bin/fetch_image?$id'>\n"; # or you can be cool and use CGI PATH_INFO stuff: print "<img src='/cgi-bin/fetch_image.cgi/$id.gif'>";
      Then either build the image from the stored information, or retrieve a temp file that matches the ID and send the resulting image, removing the file when it's done.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found