I am a newbie Perl programmer so please go easy on me. Is there any way to remotely redirect a page from calling a perl .cgi file to another page file? The user will click a link which leads to a .cgi file. The .cgi file then will redirect the user to a "file://" location. The purpose is to download a file in another server after logging for click count.
The code below works for "http://" addresses, but how do I get it to work with "file://" addresses?
#!C:\Strawberry\perl\bin
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $page = new CGI;
# print header and start the markup output
print "HTTP/1.0 200 OK\n";
print $page->header( "text/html" );
print $page->start_html( "CGI Environment" );
print "Hello world! ";
print "Press the Enter key to exit.\n";
my $url="file://location_of_file";
my $t=1; # time until redirect activates
print "<META HTTP-EQUIV=refresh CONTENT=\"$t;URL=$url\">\n";
print $page->end_html;
# end code
Is this a good approach? Is there a better approach? Please help. Thank you in advanced!