Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Download Script
bthaxor
post Jan 28 2008, 12:31 AM
Post #1


Advanced Member
*******

Group: [HOSTED]
Posts: 134
Joined: 30-October 07
From: Sydney, Australia
Member No.: 52,225
Spam Patrol



hey all,

on my website, i would to link to files that i have created/found. since these files are larger than 5mb, and i didn't want to waste my precious 500mb space, i hosted them on fileden, an online file storage site allowing hotlinking. an example of a url from this site is:

http://www.fileden.com/files/2007/10/20/15...some%20file.mp3

so anyway, on one of my pages i would like to have a link to one of these files. however, instead of streaming the file as the website would normally do for the mp3 extension, i would like to 'force' the save link as / save as dialog to appear.

i have thoroughly researched this, however all of the working solutions require the php file to be placed in the same directory as the other files, and with the random urls that fileden generates that is not possible. otherwise, they use the $filename attriibute, which uses relative urls (e.g. ../../some file.mp3), which is also not possible in this case.

the javascript solution, which works, is not firefox compatible, and since i always use firefox and am a large fan of it, i find that frustrating.

for webdesign i use xhtml+css, and do not know php. which is why i need help, since most/all of the working solutions seemed to use php.

so, my question/request: any code which is incorporateable into a html page and takes into consideration my lack of php knowledge, which forces a 'save link as/save as' dialog to appear once the user clicks on a link, and is cross-browser.

thanks so much if you are able to help.

also, one last thing: if possible, i would like this code to be php/javascript, because they are the easiest to incorporate into html. NO ASP PLEASE!!!

Notice from rvalkass:

Merged double post.
Go to the top of the page
 
+Quote Post
imbibe
post Jan 28 2008, 05:09 AM
Post #2


Member [Level 1]
****

Group: Members
Posts: 67
Joined: 25-June 06
From: Den
Member No.: 25,638



could u post the javascript solution. someone might be able to port it to FF.
And according to Trap17 rules do not make double posts. edit your original one.
Go to the top of the page
 
+Quote Post
bthaxor
post Jan 29 2008, 07:02 AM
Post #3


Advanced Member
*******

Group: [HOSTED]
Posts: 134
Joined: 30-October 07
From: Sydney, Australia
Member No.: 52,225
Spam Patrol



the javascript code (only for ie) is:

CODE
<a href="java script:void(0);" onclick="document.execCommand('SaveAs',true,'http://fileden.com/somefolder/some file.mp3');">download</a>


and sorry about the double post, it is merged.
Go to the top of the page
 
+Quote Post
galexcd
post Feb 1 2008, 06:47 PM
Post #4


Define:EVIL PROGRAMMER (ē'vəl prō'grăm'ər)- n. An organism that converts caffeine into evil software.
*********

Group: [HOSTED]
Posts: 975
Joined: 25-September 05
From: The dungeon deep below the foundation of trap17
Member No.: 12,251



I think the best solution is to zip it. That way all browsers will be forced to download it, but why are you forcing people to download this song? I like to listen to mp3's streaming in my browser.
Go to the top of the page
 
+Quote Post
bthaxor
post Feb 2 2008, 09:57 PM
Post #5


Advanced Member
*******

Group: [HOSTED]
Posts: 134
Joined: 30-October 07
From: Sydney, Australia
Member No.: 52,225
Spam Patrol



i would like to force the download because that is exactly what the link is supposed to be: a download. i have asked people if they stream their music, believe me, and NO-ONE did.

also, i really wouldn't like to resort to a zip file! that's taking the easy way out... besides, i have already uploaded all my files as mp3's, you have no idea how long that took.

one last thing: i can't tell them to right click -> save link as even if i wanted to, because i have a script which disables the right click and is cross browser (at least it stops n00bs from viewing my source... all those who don't know how to user the menu bar).

the best approach to this would most likely be a download.php, however as mentioned before i do not know php, and the scripts that are available on the net have so far all required that the php file be placed in the same directory as the files, which is not possible in this case.

i have also heard something about content disposition headers... how do they work?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Error In Purchased Script(9)
  2. How Do I Script A Tutorial Submit Site(3)
  3. Swf Cd Help Needed Please(1)
  4. Looking For Phpbb Script(2)
  5. How Can I Make An Auto-updating Shoutbox Type Script?(4)
  6. Ajax - A New Technology(10)
  7. Lightbox Script Variations(0)
  8. Streaming Video Capture On Linux(2)


 



- Lo-Fi Version Time is now: 26th July 2008 - 02:39 PM