CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Writing binary files

 



djpaul
Deleted

Jul 20, 2000, 9:02 AM

Post #1 of 2 (561 views)
Writing binary files Can't Post

I am working on an upload script which can upload image files.

I am using cgi-lib.pl, because I can't figure out how to install the CGI.pm module. Anyways, here is what I have. When I run this part of the script the image file, when accessed through a browser, looks all messed up. I thought I put the file in binary mode, so why does it still mess up?

open (ORD, ">/usr/www/users/biggins/domains/netifieds.com/write/file.jpg");
binmode (ORD);
print ORD $in{'upfile'};
close (ORD);

when I upload anything other than an image file, it works fine. What is going on?

Thanks ahead of time,
Paul


dws
Deleted

Jul 20, 2000, 12:55 PM

Post #2 of 2 (561 views)
Re: Writing binary files [In reply to] Can't Post

I assume that you're sending the form that contains the encoded file using a POST rather than a GET, since there are limitations on the overall length of a URL.

Do you have a better characterization of what's not working? Have you done a binary comparison of the file you're sending vs. the file that you're saving?

You're welcome to study and/or use my scripts, which post small binary files (e.g., webcam snapshots) through a proxy server. It should be pretty easy to rewire the posting script if you're not going through a proxy server.
http://www.postcognitive.com/tools/postbits http://www.postcognitive.com/tools/catchbits


[This message has been edited by dws (edited 07-20-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives