Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > BlueVoda Website Builder Forums > BlueVoda - General Issues

Notices

BlueVoda - General Issues All BlueVoda support issues that are not covered in the below forums.

Closed Thread
 
LinkBack Thread Tools
  #1  
Old 10-15-2007, 11:23 PM
Corporal
 
Join Date: Oct 2007
Posts: 13
Cool Option to download OR play a mp3

I want to give the public an option to EITHER download an mp3 to their computers OR listen to it on site using the Windows Media Player.
The problem is that when I click on the text link to download it to the computer, it automatically opens it in the Media Player..... If i create it as a .zip file, I am going to have to upload it twice (once as a zip and once as mp3 to listen to)..... If I right click the text link, that works, but it is not proffesional enough.....If a create the link as 'file://' instead of 'http://' , the link doesnt work...
Is there a way that I can upload the file ONCE and have the option of a download OR real time listen?

I am new so I dont have a site up and running yet, but my Client ID# is 18412

Thanx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #2  
Old 10-15-2007, 11:48 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

You need a script for that:

<?php

$filename = $_GET['filename'];
$filesize = $_GET['filesize'];
$filetype = $_GET['filetype'];
header("Pragma: public");
header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-type: Application/ $filetype");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Description: Download PHP");
header("Content-Length: $filesize");
header("Content-Transfer-Encoding: binary");
readfile($filename);
set_time_limit(0);

?>

Copy the code, paste it in notepad, and Save As "download.php". Upload it in your site.

Now, in your page create the Link for playing, as normally, and a second link, for download, as

download.php?filename=realfilename&filesize=realfilesize&filetype=realfiletype

realfilename and realfilesize and realfiletype MUST be the actual name, size and type of your file.

Of course, this will only work when published, as it is in php
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old 10-15-2007, 11:50 PM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

wow...thank you..
I will try it out

thank you so much for the quick reply
keep well
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old 10-16-2007, 12:05 AM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

IT WORKS !!!!!!!
thank you so so much
I really appreciate it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old 10-16-2007, 12:41 AM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

the file is downloading but it is not there...
seems to have gotten corrupt along the way?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old 10-16-2007, 05:48 AM
Watdaflip's Avatar
Brigadier General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 1,638
Default Re: Option to download OR play a mp3

Most likely either the filesize isn't correct (make sure its in bytes, not kb or mb), or the filename of the file on your website isn't correct (although if its a problem with the filename it should give you an error)
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old 10-16-2007, 06:24 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

Sorry, it has been my mistake. I edited the third and fourth line as the ones i gave you are from a script of mine that retrieves the details from a database, which is not your case. Replace the entire code and try it again.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old 10-16-2007, 07:06 AM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

where is the new edited script ?

also, would this be correct as an example:
"testing.mp3" which is 36kb
download.php?filename=testing.mp3&filesize=36000&filetype=mp3

Thanx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old 10-16-2007, 07:14 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

I edited directly the original post. The difference is in the third and fourth line.

In your computer, browse the folder where your mp3 is. Right click on it, Properties, and it will display the file properties. Among them the size, which will be something like (as an example) 35897 bytes. This is the number you need to pass over to the script, not a rounded value.

As for the file type, if your file is mp3, then that's the value that you need to pass to the script. So it would be:

download.php?filename=testing.mp3&filesize=35897&filetype=mp3

Make SURE the file name contains no blanks (whitespaces)
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old 10-16-2007, 07:33 AM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

I copied the text and checked the bytes:
thsi is the real code:

download.php?filename=anybody.mp3&filesize=37393&filetype=mp3

still not working?
the test site is www.mcpbm.com

thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old 10-16-2007, 07:58 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

I will back to you within 1 hr as i am busy now, and we will sort this out.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old 10-16-2007, 04:13 PM
Corporal
 
Join Date: Oct 2007
Posts: 13
Post Re: Option to download OR play a mp3

I think i found the problem, but I dont know how to solve it
In the same folder as my mp3 file there is file called "error_log".
In there the following message appears every time i try the link:

[16-Oct-2007 08:48:59] PHP Warning: readfile() has been disabled for security reasons in //public_html/test/download.php on line 15

how do I stop this problem? Is it through my cpanel?

Thanx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
Old 10-16-2007, 07:12 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

readfile should not be disabled. If it is, please submit a suppor ticket asking for it to be enabled. I believe VH staff can enable it in the php settings.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #14  
Old 10-17-2007, 11:24 AM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

thank you very much for all your help
VH inserted a file called "php.ini" into my public_html directory and it all works fine
(a guy from the IT department said that if I replaced readfile() with include() it would also work but that it is more secure to stick to readfile())

thanks again

Last edited by Jacho; 10-17-2007 at 11:27 AM. Reason: added a point of interest
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #15  
Old 10-17-2007, 11:33 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

Hi Jacho,

no, include() will not work. You see include() embedds the file content in your script, whilst readfile() reads the content, and pushes it through the header command to the users browser.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #16  
Old 10-21-2007, 11:18 PM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

hi it's me again
everything is working great for mp3's but still got problems with .wav files. won't download them? is the download.php code above only for mp3's?
thanx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #17  
Old 10-21-2007, 11:47 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

The code is for ANY type of file. Make sure you have no mistakes.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #18  
Old 10-21-2007, 11:55 PM
Corporal
 
Join Date: Oct 2007
Posts: 13
Default Re: Option to download OR play a mp3

i really have no mistakes
it downloads all my mp3 files and not any of my wav files
?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #19  
Old 10-22-2007, 06:38 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,342
Default Re: Option to download OR play a mp3

Please create and provide a link to download a wav file. as a test
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!