473,387 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Saving GIFs in CGI

Hi
Im writing a java applet that calls a perl script to save pictures
generated by the applet locally. The applet converts the onscreen
buffer into a GIF and sends in via POST in a byte stream. The problem
im having is at the cgi end. The data should be saved as a .gif file,
but when I do this nothing gets saved. If I save it as a text file I
get a load of unrecognisable characters. Below is my perl code, ive
tried adding binmode and it made no difference. I have read that i
should be using read() instead of <> because its a binary file but
havent managed to get this to work either.
Any help would be much appreciated

Ed

#!/usr/bin/perl -w

#use constant BUFFER_SIZE => 4_096
#my $buffer = "";
#binmode STDIN;
#binmode OUTPUT;

open (OUTPUT, '>>/Users/ed/Sites/jp.gif') or die "cant open";
binmode OUTPUT;
while(<STDIN>) {
print OUTPUT $_;
}

#$data = read(STDIN, $buffer, BUFFER_SIZE);
#print OUTPUT $data;

close OUTPUT;
Jul 19 '05 #1
0 1669

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jerrygarciuh | last post by:
Hello everyone, Wondering if anyone else has had problems with gifs created by php or if anyone sees a problem with this code. Symptom: created jpegs work fine and created gifs work fine in...
3
by: jerrygarciuh | last post by:
Hello everyone, Wondering if anyone else has had problems with gifs created by php or if anyone sees a problem with this code. Symptom: created jpegs work fine and created gifs work fine...
4
by: tnhoe | last post by:
Hi, how do i code such that all gifs are loaded without missing any one of them ? I always get missing few gifs when the page loading with 30 gifs. I use IE6 to browse many <a...
2
by: darrel | last post by:
I have written an image upload/resize tool that then saves out the image as either a JPG or GIF. I got the JPG save working nicely, using a codec and setting the compression to 90%. However,...
0
by: GrandpaB | last post by:
I am creating a small simulation in VB and wish to incorporate several animated GIFS. I can load the GIFS from the hard drive into a picture box and they animate, but I have two questions. 1.)...
2
by: Scirious | last post by:
People, I need a way to detect the moment an animated GIF gets to it's end to switch to a different GIF. I can't use a Timer because the GIFs have different times and doing so (as I'm doing at the...
3
by: ZikO | last post by:
Hi. I am making a Multimedia Presentation in VB.NET 2005 and I have some animated GIFs which I need to use. I tried to use PictureBox for it but it doesn't play an animation in GIFs :/. What I...
4
by: Jeff | last post by:
Hi, I'd like to write Javascript that stops animated gifs from animating. On Firefox, at least, window.stop(); does the trick, although it stops everything on the page and is kind of...
0
by: helraizer1 | last post by:
Hey, I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.