• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

File Downloading using Perl

kennymoens

New Member
Hi,

My script:
Code:
print "Location: $url\n\n";

$url is filled by a mySQL database, I'm sure it returns a correct URL, it is a *.zip file.

When I enter the page, i get, instead of a download, a page with the content of the zip file in text format (all chinese signs or something strange).

[EDIT]
There is no "Content/Type" above this text (yes, it is, but in another function. Which is not called before this one.
[/EDIT]

Hope you can help.
 
Last edited:
DON"T put


print "Content-Type: text/html\n\n"; OR
print "Content-Type: text/plain\n\n";

The complete source code by Yupapa
=============================================
#!/usr/bin/perl
print "Location: $url\n\n";

IF not, show me the entire script!
 
I just found the solution, it was in my starting conditions.
It executed the procedure with
print "Content-Type: text/html\n\n";

Still thx for help
 
Location: url should work anyways, it depends on what is happening at the url, not the script that redirects the user to it.
 
Back
Top