Jump to content

Save As?


Recommended Posts

I am thinking about making a ringtone website

and started on the files but I came accross a HUGE problem,

sending the ringtones to the phone  ;D

But I came up with a solution,

I want to create a link that links to the mp3 file,

such as

<a href="/music/song.mp3">Get File</a>

But then i realized that the link will only take you to the page

where the ringone is located,

can someone let me know what the javascript code is

so that when they click on the link it will save?

i tried looking this up on google,

and i think you need to be using the "onClick"

thing but since I dont really know anything about javascript

I have no idea what exactly to put it.

I found a code that does this in javascript

<html>
<head>
<script language="JavaScript">

var isReady = false;
function doSaveAs(){
if (document.execCommand){
if (isReady){document.execCommand("SaveAs");}
}else{
alert('Feature available only in Internet Exlorer 4.0 and later.');
}
}

</script>
</head>

<body onload="isReady=true">
<a href="javascript:doSaveAs(/music/song.mp3)">
Get File
</a>
</body>
</html>

but it only worked in

IE, and i figured that it wont work through a phone,

does anyone know how to make a javascript code that

saves the target (the song) and works through a phone?

Link to comment
https://forums.phpfreaks.com/topic/55895-save-as/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.