Forum Moderators: coopster & phranque

Message Too Old, No Replies

Downloading and image in perl

         

protheus99

8:24 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



I have been working on a script to download images but i haven't had much success can anyone help me out?

here is what i got so far ...

#!/usr/bin/perl
use integer;
use strict;
use warnings;
use CGI;

my($q) = CGI -> new();
my($file_name) = "#Enter the file name here with full path here";
print $q -> header('application/x-octet-stream');
#print $file_name;
open(INX, $file_name) ¦¦ die("Can't open($file_name): $!");
binmode(INX);
$/ = undef;
my($data) = <INX>;
close(INX);
binmode(STDOUT);
exit;
}

tschild

3:08 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



1. You refer to downloading. The method that you use for getting the data only works for local files.

2. You read the file in to the variable $data but you do not output that variable.