| | |
how to get links to request save?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 24
Reputation:
Solved Threads: 0
hey im sorry if this question was asked before. im starting a new page, and i want users to be able to download songs from it, without having to right click the link and click save target...is there a html tag that would allow the link to request whether to save or open the file when it is clicked?
thanks
thanks
php Syntax (Toggle Plain Text)
<?php if(!$file) return false; /* properly verify filename as well this is just a demo script as is this is a huger security hole */ header("Content-disposition: attachment; filename=$file"); header('Content-type: application/pdf;'); /* application/octet_stream etc or pull the content type from your database as a variable or a list etc */ readfile("$file"); ?>
savefile.php
usage
html Syntax (Toggle Plain Text)
<a href='filesave.php?file=thisfile.ext'>download thisfile.ext</a>
Last edited by almostbob; Mar 21st, 2009 at 12:36 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- C# server.transfer to save form data and send email (ASP.NET)
- IE doesn't launch (Viruses, Spyware and other Nasties)
- another newbie with alot of redhat and apache server Q'S (Linux Servers and Apache)
- locking up the pc. (Viruses, Spyware and other Nasties)
- Searchportal.com (Viruses, Spyware and other Nasties)
- hijacker.exe help, have no clue what's causing problem and don't want to delete good (Viruses, Spyware and other Nasties)
- ads234 is driving me NUTS (Viruses, Spyware and other Nasties)
- Another Hijack log... please help me... (Viruses, Spyware and other Nasties)
- Need Help for DNS Problem and 'about:blank' Problem ... (Viruses, Spyware and other Nasties)
Other Threads in the HTML and CSS Forum
- Previous Thread: webpage does not look right in IE
- Next Thread: Problem with Nesting List
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash font fonts form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl






