my $file = "/path/to/file.mp3"; my $filesize = -s "$file"; print $cgi->header( -type => "audio/mp3", -Content_length => "$filesize", -content_disposition => "attachment; filename=$params->{cgi}->{fileId}.$params->{cgi}->{fileType}"); #This has been tried with -content_disposition and without open(FILE, "$file"); binmode(FILE); binmode(STDOUT); while () { print; } close(FILE);