Home  |  About  | Last |  Submit  |  Contact
AllQuests.com




Previous Question:  [all 1f40 variants] having few troubles with cd rom and video playback  Absolute Beginner TalkNext Question:  [ubuntu] My audio quit working  Absolute Beginner Talk
Question Help with Dowmload code ( SitePoint Forums PHP )
Updated: 2010-07-21 05:50:02 (3)
Help with Dowmload code

Good day all, i've been trying to get files like jpeg, pdf to be downloadable on a click for download from my site. What i've been able to do just to get them to preview on the net. this files are heavy in MB & takes times to load on a browser. When u save as a jpg, and want to read, the pixels are so bad, u cant read them. The PDF files on thier own, takes more time to preview cos they are heavier than the jpg

Plesae can someone help me with this download code, it could be n php or java. I would really appreciate it

Answers: Help with Dowmload code ( SitePoint Forums PHP )
Help with Dowmload code

do a search for php force download

crmalibu

Help with Dowmload code

little bit confused with your question, do you mean want to download those files in a "new tab" ? if so, this code might help :

PHP Code:

<?php
$name
= basename($filename);
$size = getimagesize($filename);
$len = filesize($filename);
header("Content-type: {$size['mime']}");
header("Content-Length: $len");
header("Content-Disposition: attachment; filename=$filename");
readfile($filename);
?>
Good luck

atpaz

Help with Dowmload code

so do you want that file rather to be downloaded than being watched out by users directly ?

If yes, have a look Here

bamaboy

Previous Question:  [all 1f40 variants] having few troubles with cd rom and video playback  Ubuntu Forums  Absolute Beginner TalkNext Question:  [ubuntu] My audio quit working  Ubuntu Forums  Absolute Beginner Talk

- Source: Help with Dowmload code SitePoint Forums PHP
- Previous Question: [all 1f40 variants] having few troubles with cd rom and video playback Ubuntu Forums Absolute Beginner Talk
- Next Question: [ubuntu] My audio quit working Ubuntu Forums Absolute Beginner Talk