![]() | | ||||||||
| | #1 |
| Active Warrior War Room Member Join Date: Aug 2008 Location: United Kingdom Birmingham
Posts: 92
Thanks: 23
Thanked 1 Time in 1 Post
|
Hi, i am not too clued when it comes to web design. I have just downloaded filezilla and uploaded an ebook to a folder on my server, but not sure how i can provide a download link for my customers to download that ebook. I know it sounds silly and i think i am nearly there. Hope someone can enlighten me on this. Thanks in advance. |
| | |
| | #2 |
| Active Warrior Join Date: Sep 2008
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
If you uploaded the ebook to your "www" folder, you can get people to download it by making a link that points to: http://www.example.com/ebook.pdf Obviously replace example.com with your website name and ebook.pdf with the file name of your actual ebook. If you uploaded it to a subdirectory, all you have to do is change the path. For example, if you uploaded to "www/downloads/ebook.pdf", you would link to "http://example.com/downloads/ebook.pdf" To make a link, see here: HTML Links |
| | |
| | #3 |
| and his shiny metal ... War Room Member Join Date: Apr 2004 Location: 42.751109°N 73.408756°W
Posts: 1,407
Thanks: 528
Thanked 1,079 Times in 754 Posts
|
If you link to the PDF then when anyone clicks on it, it will open the PDF and they won't actually download it unless they save it when it is open. Robert Plank put this code in the main forum last year that will make the PDF downloadable. <?php // Change this to the filename of your PDF file $filename = "filename.pdf"; if (!file_exists($filename)) { header("HTTP/1.0 404 Not Found"); echo "<h1>404 Not Found</h1>"; die(); } header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="' . basename($filename) . '"'); echo file_get_contents($filename); die(); ?> Change the filename that's underlined above to the name of your PDF. Copy the code to to a blank file in wordpad or what ever text editor you use and name it what ever you want with a .php extension, like ebook.php Upload that and the PDF to your site and on the web page link to that file like this http://sitename.com/ebook.php Then when they click on the link it will download to their computer instead of opening in their browser. |
| I Donated to KimW - give a sig link to Kim W Life: Nature's way of keeping meat fresh Always remember that you are unique. Just like everyone else. No matter how deep the ocean is, you can still break a window with a hammer Getting old ain't for sissy's | |
| | |
| | #4 |
| HyperActive Warrior Join Date: Mar 2008 Location: Amsterdam , Netherlands.
Posts: 156
Thanks: 3
Thanked 1 Time in 1 Post
|
Hi, Just a thought. If someone stumbles across your download folder they could get access without you knowing so include an index.html in the folder as follows. ********************************** <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <meta name="robots" content="noindex,nofollow"> </HEAD> <BODY> <CENTER> <TABLE BGCOLOR="white" WIDTH="650" BORDER="5" BORDERCOLORDARK="gray" BORDERCOLORLIGHT="white" CELLPADDING="5"> <CENTER> <tr> <th>You are not allowed to access this area. Please <a href="http://www.your-domain.com">click here</a> to go to our main page. </th> </tr> </center> </table> </body> ************************************************* Good luck Quicksilver The HTML Book, with free HTML code. |
| | |
| | #5 |
| HyperActive Warrior War Room Member Join Date: Aug 2008 Location: Adelaide, South Australia
Posts: 327
Thanks: 54
Thanked 23 Times in 18 Posts
|
Quicksilver has a good point, but instead of giving them a nasty error message, it might be better to just redirect them to the main page. Or better yet, redirect them to a sales page! ![]() Just do this with an index.php file and put the redirection code in that. Code: <? header("Location: http://www.mysite.com/buythisproductnow"); ?> |
|
Cheers, John
| |
| | |
![]() |
|
| Tags |
| download, files, upload, website |
| Thread Tools | |
| |
![]() |