in reply to Re: Download File using CGI
in thread Download File using CGI
and only#!/usr/bin/perl -w use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); my $updated = ""; ## set up the HTML page with the header and title lines print header; # start HTML head print start_html("Download page"); # print title bar with string print <<ENDH; Content-type: application/octet-stream Content-Disposition: attachment; filename: $updated ENDH open FILE,"<updated/$updated" or die "Can't open: $!"; binmode FILE; local $/ = \10240; while (<FILE>) { print $_; } close FILE; print end_html;
in the other file. Is this right.print('<a href="download.cgi?file=$updated">Download Files here</a>');
It comes out with an error message, simply $updated not defined. How do i pass the file name and its contents through to this download.cgi script without having to declare it at the top.
Cheers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Download File using CGI
by Joost (Canon) on Jun 01, 2005 at 15:36 UTC | |
|
Re^2: Download File using CGI
by Anonymous Monk on Jun 02, 2005 at 07:46 UTC | |
by MonkPaul (Friar) on Jun 03, 2005 at 09:06 UTC |