Website Babble Webmaster Forums  


Go Back   Website Babble Webmaster Forums > Making Money > Hard Goods (Online Stores), E-Goods (e-Books, etc.)

Your WB Notifications

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-17-2008, 01:01 PM
Master Babbler
 
Join Date: Apr 2008
Posts: 114
bigtunafan has a few positive reputation points
Default E-Book Question

I have created an eBook and I'm wondering how I can make it where my subscribers can save the eBook to their desktop without having to zip it. Right now to view it, you must book mark it. Any help would be appreciated.
__________________
Whether you're looking for Discount Poker Chips or the
Top Poker Rooms you can find it at Texas Holdem Poker.
Reply With Quote
  #2 (permalink)  
Old 09-17-2008, 02:10 PM
lisa's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 7,432
lisa is the Admin and cannot be rated.
Default

What I do is just link directly to the PDF file and instruct them to right-click and download it. That way it forces them to save it to their computer.
__________________
Don't put the cart before the horse.
Plan your website, then create it.

Your Free Guide to Starting a Website
http://www.ThePerfectSiteGuide.com




Reply With Quote
  #3 (permalink)  
Old 09-17-2008, 10:00 PM
codemonkey's Avatar
Master Babbler
 
Join Date: Sep 2008
Location: New Jersey
Posts: 158
codemonkey is a reputable WB member and has over 100 reputation pointscodemonkey is a reputable WB member and has over 100 reputation points
Default

Hi bigtunafan,

I think what your looking for is a dialog prompt to save or open.

If this is the case, all you need is a link and a little php file.
It should look something like this:

your link:
<a href="your-domain/download_book.php?file=e-book-name.pdf">
e-book-name</a>

your php file: download_book.php
PHP Code:
<?php
     header
('Content-type: application/pdf');
     
header('Content-Disposition: attachment;  filename='.basename($_REQUEST['file']));
     
header('Content-Transfer-Encoding: binary');
     
readfile($_REQUEST['file']);
?>
you could also fopen, fclose, fpassthru, echo, whatever there are lots of way to do it. If this doesn't work, let me know and i'll be more detailed.
Good Luck
__________________
Drop by my websites:
HamsterWebcam.com
RubyShack.com
(new)
Reply With Quote
  #4 (permalink)  
Old 09-19-2008, 05:02 PM
codemonkey's Avatar
Master Babbler
 
Join Date: Sep 2008
Location: New Jersey
Posts: 158
codemonkey is a reputable WB member and has over 100 reputation pointscodemonkey is a reputable WB member and has over 100 reputation points
Talking Try it out!!

bigtunafan,

I haven't haven't heard back from you...
How did you make out?

In case you haven't tried the sample code I provided...
I've implemented the code on my server so you could try it out for yourself.

Here is the link, let me know if this is what you were asking for:
http://hamsterwebcam.com/php/E-Book.php

I have provided a very interesting e-book also
Let me know!!
__________________
Drop by my websites:
HamsterWebcam.com
RubyShack.com
(new)
Reply With Quote
  #5 (permalink)  
Old 09-19-2008, 05:07 PM
Master Babbler
 
Join Date: Apr 2008
Posts: 114
bigtunafan has a few positive reputation points
Default

I haven't had the opportunity to implement the code yet, will probably do so tonight. I can guarantee I'll probably have a few problems implementing it. Not so much the code, just my denseness in trying.
__________________
Whether you're looking for Discount Poker Chips or the
Top Poker Rooms you can find it at Texas Holdem Poker.
Reply With Quote
  #6 (permalink)  
Old 09-20-2008, 06:00 AM
Master Babbler
 
Join Date: Apr 2008
Posts: 114
bigtunafan has a few positive reputation points
Default

Hey Codemonkey,

You believe you lost me at "php". I have the code copied to my text editor but from there I don't have a clue what to do. How do I link the eBook to the php file and so forth?

Php is something I've been wanting to learn but feel quite intimidated by the language.
__________________
Whether you're looking for Discount Poker Chips or the
Top Poker Rooms you can find it at Texas Holdem Poker.
Reply With Quote
  #7 (permalink)  
Old 09-20-2008, 10:58 AM
codemonkey's Avatar
Master Babbler
 
Join Date: Sep 2008
Location: New Jersey
Posts: 158
codemonkey is a reputable WB member and has over 100 reputation pointscodemonkey is a reputable WB member and has over 100 reputation points
Lightbulb PHP (how and why)

Quote:
Originally Posted by bigtunafan View Post
Hey Codemonkey,

You believe you lost me at "php". I have the code copied to my text editor but from there I don't have a clue what to do. How do I link the eBook to the php file and so forth?

Php is something I've been wanting to learn but feel quite intimidated by the language.
OK bigtuna, here we go....

So you understand exactly, we'll assume the e-book file is named "e-book.pdf"
and your domain is called bigtuna.com (for demonstration purposes only).
We will also assume that the html file (where you will put the link)
is called download.html and all files will be in your website root or home directory.

1.) Copy the code I posted (in the php box) exactly as is to a text editor.

2.) Save the file locally (to your drive) as download_book.php
The file type should be Text Document or Text Document MS-Dos Format

3.) Close the text editor and look for the file you saved, it should be named download_book.php - if it's named download_book.php.txt just rename (take the .txt off)

4.) Now upload this file using a ftp (file transfer protocol) program (or however you normally do it) to the same location as your e-book (e-book.pdf)
also the same location as your original html file (download.html) where you will be putting the link

5.) Now add this link to download.html
<a href="http://bigtuna.com/download_book.php?file=e-book.pdf">Download e-book here</a>

6.) save download.html and ftp it to the website root of your server.

The following files should now be on your server at this location:
please adjust the domains and file paths to your situation.

It will work and Now to explain WHY it works...

As you can see the <a href link is really calling download_book.php
but it's also passing a parameter ?file=e-book.pdf

We gave this parameter a reference name "file" and
assigned the literal "e-book.pdf" to it.

passing parameters through a URL link like this
is using http-get as opposed to http-post

NOTE: passing multiple parameters through the URL are normally separeted by & which should really be &amp; this becomes an issue when trying to W3C validate document types (see w3c validation post) on this forum

The php interpreter recognizes the <?php tag in the php file and starts processing until ?> which is a signal to stop.

the header commands tell what kind of file it is and how it should be handled notice the attachment reference, we give the filename by using the php code .basename($_REQUEST['file'])
.basename will give you the filename without the full path
and $_REQUEST['file'] is extracting the parameter with the reference name "file" from the passed variables.
$_GET could also be used
$_POST is how to extract passed data through posting
and $_SERVER is usually how a program knows things like what what you ip address is $_SERVER['REMOTE_ADDR'] etc....

readfile($_REQUEST['file']); is again requesting the contents of parameter
named "file" and opening it and reading the file to the ouput buffer

we defined the output buffer in our header declarations so the file is an attachment and would stream down to the user.
The browser detects and identifies the stream and gives you the OPEN or SAVE dialog box!!

Whew....

That's all for now, let me know if you have trouble applying it to your situation.
__________________
Drop by my websites:
HamsterWebcam.com
RubyShack.com
(new)
Reply With Quote
  #8 (permalink)  
Old 10-01-2008, 07:30 PM
jazzguy's Avatar
Super Moderator
 
Join Date: Dec 2007
Location: Montreal, Canada
Posts: 529
jazzguy has a rock solid WB reputation (over 200 points)jazzguy has a rock solid WB reputation (over 200 points)jazzguy has a rock solid WB reputation (over 200 points)
Default

Quote:
Originally Posted by codemonkey View Post
OK bigtuna, here we go....

So you understand exactly, we'll assume the e-book file is named "e-book.pdf"
and your domain is called bigtuna.com (for demonstration purposes only).
We will also assume that the html file (where you will put the link)
is called download.html and all files will be in your website root or home directory.

1.) Copy the code I posted (in the php box) exactly as is to a text editor.

2.) Save the file locally (to your drive) as download_book.php
The file type should be Text Document or Text Document MS-Dos Format

3.) Close the text editor and look for the file you saved, it should be named download_book.php - if it's named download_book.php.txt just rename (take the .txt off)

4.) Now upload this file using a ftp (file transfer protocol) program (or however you normally do it) to the same location as your e-book (e-book.pdf)
also the same location as your original html file (download.html) where you will be putting the link

5.) Now add this link to download.html
<a href="http://bigtuna.com/download_book.php?file=e-book.pdf">Download e-book here</a>

6.) save download.html and ftp it to the website root of your server.

The following files should now be on your server at this location:


please adjust the domains and file paths to your situation.

It will work and Now to explain WHY it works...

As you can see the <a href link is really calling download_book.php
but it's also passing a parameter ?file=e-book.pdf

We gave this parameter a reference name "file" and
assigned the literal "e-book.pdf" to it.

passing parameters through a URL link like this
is using http-get as opposed to http-post

NOTE: passing multiple parameters through the URL are normally separeted by & which should really be &amp; this becomes an issue when trying to W3C validate document types (see w3c validation post) on this forum

The php interpreter recognizes the <?php tag in the php file and starts processing until ?> which is a signal to stop.

the header commands tell what kind of file it is and how it should be handled notice the attachment reference, we give the filename by using the php code .basename($_REQUEST['file'])
.basename will give you the filename without the full path
and $_REQUEST['file'] is extracting the parameter with the reference name "file" from the passed variables.
$_GET could also be used
$_POST is how to extract passed data through posting
and $_SERVER is usually how a program knows things like what what you ip address is $_SERVER['REMOTE_ADDR'] etc....

readfile($_REQUEST['file']); is again requesting the contents of parameter
named "file" and opening it and reading the file to the ouput buffer

we defined the output buffer in our header declarations so the file is an attachment and would stream down to the user.
The browser detects and identifies the stream and gives you the OPEN or SAVE dialog box!!

Whew....

That's all for now, let me know if you have trouble applying it to your situation.
WTF!!???

Neeeeeeeeeeeee!!!
Reply With Quote
  #9 (permalink)  
Old 10-01-2008, 10:44 PM
Junior Babbler
 
Join Date: Aug 2008
Posts: 17
Shaukat has a few positive reputation points
Default

The best way to do it is to create a PDF and tell your subscribers to Right Click on the link and then choose "Save Target As..."
__________________
Your Complete Guide to Selling Downloadable Products Online:

Learn to sell downloads - sell ebooks, sell mp3, sell pdf, etc.
Reply With Quote
  #10 (permalink)  
Old 10-03-2008, 07:12 PM
codemonkey's Avatar
Master Babbler
 
Join Date: Sep 2008
Location: New Jersey
Posts: 158
codemonkey is a reputable WB member and has over 100 reputation pointscodemonkey is a reputable WB member and has over 100 reputation points
Default

Quote:
Originally Posted by jazzguy View Post
WTF!!???

Neeeeeeeeeeeee!!!

__________________
Drop by my websites:
HamsterWebcam.com
RubyShack.com
(new)
Reply With Quote
  #11 (permalink)  
Old 10-03-2008, 07:34 PM
jazzguy's Avatar
Super Moderator
 
Join Date: Dec 2007
Location: Montreal, Canada
Posts: 529
jazzguy has a rock solid WB reputation (over 200 points)jazzguy has a rock solid WB reputation (over 200 points)jazzguy has a rock solid WB reputation (over 200 points)
Default

Quote:
Originally Posted by codemonkey View Post

That's a hoot CM...but you gotta make it Root Beer as I don't drink...ever since that night in Reno where I...well anyway...neeeeeeee to you and many more...
Reply With Quote
  #12 (permalink)  
Old 10-03-2008, 08:05 PM
codemonkey's Avatar
Master Babbler
 
Join Date: Sep 2008
Location: New Jersey
Posts: 158
codemonkey is a reputable WB member and has over 100 reputation pointscodemonkey is a reputable WB member and has over 100 reputation points
Default

Quote:
Originally Posted by jazzguy View Post
That's a hoot CM...but you gotta make it Root Beer as I don't drink...ever since that night in Reno where I...well anyway...neeeeeeee to you and many more...
Ha! Ha! Ha!
The Biggest Little City in the World!!


I may have seen your picture in the Post Office,
no worries as long as you stay in Canada.

House of the Rising Sun just came on the radio

NOTE:
I do drink
__________________
Drop by my websites:
HamsterWebcam.com
RubyShack.com
(new)
Reply With Quote
  #13 (permalink)  
Old 10-03-2008, 08:29 PM
jazzguy's Avatar
Super Moderator
 
Join Date: Dec 2007
Location: Montreal, Canada
Posts: 529
jazzguy has a rock solid WB reputation (over 200 points)jazzguy has a rock solid WB reputation (over 200 points)jazzguy has a rock solid WB reputation (over 200 points)
Default

Quote:
Originally Posted by codemonkey View Post
Ha! Ha! Ha!
The Biggest Little City in the World!!


I may have seen your picture in the Post Office,
no worries as long as you stay in Canada.

House of the Rising Sun just came on the radio

NOTE:
I do drink
If I had a dime for every time I have taught "House of the Rising Sun" to my guitar students, I'd have about thirty cents... See what I did there...?

And the post office photo is not of me but of my evil twin...Kyle...or gazzjuy..whichever you prefer...now where are my sunglasses...
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -6. The time now is 01:18 PM.


 Subscribe to RSS

WB Sponsors

flash chat

Home Jobs Online

Search Engine Marketing

Paid Surveys

custom website design

Web Design Newcastle

Bookmarking Demon 5



 Subscribe to the Website Babble Feeds

2 Create a Website Homepage | 2 Create a Website Blog


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0