PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 8th, 2002, 07:23 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Force Download with the default filename of the actual file

Hi, currently i have a system set which forces people (on most browsers) to save the pdf document in question to disk. When this document saves the default save name is the name of the script rather then the name of the pdf document. Is there a way for me to make the default save name the actual name of the pdf document? here is my code...

@$fileName = "27xSdox/$filedata.pdf";
@$filesize = filesize($fileName);
if($filesize) {
@Header("Content-Length: ".$filesize);
@Header("Content-Disposition: attachment; filename=".$fileName);
@readfile($fileName);
}

thanks

Reply With Quote
  #2  
Old August 8th, 2002, 01:52 PM
jorgen jorgen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hardenberg, Holland<marquee>
Posts: 284 jorgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Force Download with the default filename of the actual file

I thought that browsers take the title as a savename.
I'm not sure...

Reply With Quote
  #3  
Old August 8th, 2002, 02:30 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Force Download with the default filename of the actual file

Here's a thread at phpbuilder that might be of some help. Different browsers download differently, and this script takes that into account...

http://www.phpbuilder.com/forum/rea...4&thread=135500

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Force Download with the default filename of the actual file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway