Hi To all, I have a script for downloading file from the server.The Problem is when i try to download WMA file it get download but it is not playing.when i try to play this file in Windows Media Player It gives the following error
Windows Media Player cannot play the file. The file is either corrupt or the Player does not support the format you are trying to play.
Here is My script
[CODE=Perl]#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrow ser);
my $cgi=new CGI;
my $files_location ;
my $ID;
my @fileholder;
my $files_location = "c:/perl/";
my $cFile = $cgi->param('file' );
if ($cFile eq '') {
print "Content-type: text/html\n\n";
print "You must specify a file to download.";
} else {
my $cFile=$files_l ocation.$cFile;
open(DLFILE, "<$cFile") || die "cannot open the File $! $cFile";
@fileholder = <DLFILE>;
close (DLFILE) || Error ('close', 'file');
print "Content-Type:applicatio n/x-download\n";
print "Content-Disposition:att achment;filenam e=$cFile\n\n";
print @fileholder
}[/CODE]
Is any chance the file get corrupt while downloading Or the Script is not efficient one.
Please Help On this.
Thank In advance.
Regards
RajivGandhi
Windows Media Player cannot play the file. The file is either corrupt or the Player does not support the format you are trying to play.
Here is My script
[CODE=Perl]#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrow ser);
my $cgi=new CGI;
my $files_location ;
my $ID;
my @fileholder;
my $files_location = "c:/perl/";
my $cFile = $cgi->param('file' );
if ($cFile eq '') {
print "Content-type: text/html\n\n";
print "You must specify a file to download.";
} else {
my $cFile=$files_l ocation.$cFile;
open(DLFILE, "<$cFile") || die "cannot open the File $! $cFile";
@fileholder = <DLFILE>;
close (DLFILE) || Error ('close', 'file');
print "Content-Type:applicatio n/x-download\n";
print "Content-Disposition:att achment;filenam e=$cFile\n\n";
print @fileholder
}[/CODE]
Is any chance the file get corrupt while downloading Or the Script is not efficient one.
Please Help On this.
Thank In advance.
Regards
RajivGandhi
Comment