Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-18-2004, 12:27 PM   #1
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Red Hat, openBSD,Mandrake,freeBSD,SunOS
Posts: 168

Rep: Reputation: 30
mod_perl and sending files to the client


I am trying to send a file to the user so they can download it. I have it working but I want to make it conform to mod_perl but I don't know how to convert what I have to be more mod_perl like.

Basically this is what I send to the client. There is more above this but I don't need help on that.
# Three lines I want to change:
$r->print("Content-Type: application/\n");
$r->print("Content-Transfer-Encoding: binary\n");
$r->print("Content-Disposition: attachment; filename=\"$fileName\"\n\n");

#creating the excel file

#opening the file
my $XLS = Symbol::gensym();
open $XLS, "$path" or die "Can't open $path: $!\n";
binmode( $XLS );
#sending the file to the client
The part I want to change but can't seem to find any good info on is the sending of the Content-Diposition. This is what I have so far:
Any help would be appreciated. Also, am I sending the file correctly? It works but are there better ways?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lynx browser, alternate mail client for sending comments to website authors SharpyWarpy Linux - Software 2 08-04-2005 11:21 AM
Sending message from server to client paulwong Linux - Networking 6 07-22-2005 10:55 AM
sending Objects from Server to Client djgerbavore Programming 0 10-04-2004 01:09 PM
gaim sending files moger Slackware 2 07-03-2004 01:44 PM
sending files over my network sandy_obrien Linux - Networking 6 05-02-2004 03:49 PM

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration