Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

want to: click button -- download music


  • Please log in to reply

#1
funnybone

funnybone

    Member

  • Member
  • PipPip
  • 11 posts
Hello:

I'm trying to get a web page set up to where a person can click a button and have an mp3 file end up on his/her desktop, from my server, to be copied to disk.

I know enough html to get an <a> TAG </a> to work, but not too much more.

I can upload files with my FTP site. .. how do you get them down?

Thanks,
Funnybone

Edited by funnybone, 25 December 2010 - 04:54 PM.

  • 0

Advertisements


#2
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts
Download Link:

You have to zip the file to trigger the browser's response to Save File. Otherwise, it will call a program to play/open the media/PDF file.

How to Zip or Unzip a file:
http://www.mantex.co...es/down-zip.htm
http://office.micros...1276901033.aspx

Making an image a link:

<p><a href="URL path to zipped file" title="Mouseover Description"><img style="width: XXpx; height: YYpx; border: 0;" src="Path to image" alt="Text Description"></a></p>

Text Link only:

<p><a href="URL path to zipped file" title="Mouseover Description">Link Text Description</a></p>

Open Main Page and Affiliate's:

<p><a href="http://mainlinkhere/" onclick="window.open('http://affiliatelinkhere','newwin');" title="affiliate product's name"><img style="width: XXpx; height: YYpx; border: 0;" src="Path to image" alt="Text Description"></a></p>

You can change the "p" tags to div tags and style as needed.

Forcing File Downloads in PHP: http://elouai.com/force-download.php
Using PHP Headers to Force Download: http://www.ryboe.com...-force-download

Edited by AstraNut, 25 December 2010 - 08:42 PM.

  • 0

#3
funnybone

funnybone

    Member

  • Topic Starter
  • Member
  • PipPip
  • 11 posts
OK. Thank you very much.

Zipping an mp3 file didn't save much space.

Is the music going to undergo any degradation for the additional compression?
  • 0

#4
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts
Zipping is not used that much to save space in this unstance as to trigger the browser's download function. It shouldn't affect the music quality as nothing is removed that isn't added when file is uncompressed. If you are worrying about this, then leave the music in its native format and use the PHP code to force a download.

Edited by AstraNut, 26 December 2010 - 02:25 AM.

  • 0

#5
Raikia

Raikia

    Member

  • Member
  • PipPip
  • 17 posts
AstraNut is correct. Zipping music does not cause any quality degradation at all. I would, however, recommend forcing the download through PHP headers as opposed to zipping your music files. The reason for this is twofold. Firstly, there are always those people on the internet who have never heard of a zip file before and have no idea what to do with it. Secondly, It is easier to maintain and faster to add music to your website (if you are adding hundreds of mp3s to your website, you don't want to have to zip each one).

Zipping one file for the purpose of triggering the browser's download function is fairly excessive unless you do not have PHP support on your server. Zipping is primarily used for grouping a bunch of files into one download.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP