HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 12th, 2000, 03:21 AM
dragos dragos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 27 dragos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm working on an intranet application. I want to know how can be made that when an user clicks a link to file (mp3) instead of downloading it, to start the viewer for that file (winamp)? If I type the URL (serversharepathfile) in the Internet Explorer 5 address bar it works perfectly, but if I code: window.location.href=URL; the browser pops up the downloading window.

Reply With Quote
  #2  
Old October 12th, 2000, 07:35 AM
tvanbart tvanbart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 35 tvanbart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
You could try <a href="file:[fullpath to file]"> or perhaps using <embed> tags?

Please let's know the outcome, since I'm ot in a position to try this right now.

Success, Ton

[This message has been edited by tvanbart (edited October 12, 2000).]

[This message has been edited by tvanbart (edited October 12, 2000).]

Reply With Quote
  #3  
Old October 12th, 2000, 10:55 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 53
You need to use the <EMBED> tag. Also, bear in mind that the browser will probably try to refresh to a page that only has the music player in it, so if you don't want to lose the rest of your HTML, you should put the embed in a separate frame. You can hide the frame, but sometimes audio files require the user to click the 'start' button on the media player to start the sound.

Unfortunately, scripting of sound files in the browser is still about as primitive as it was 4 years ago, unless you use ActiveX, or Java.

Reply With Quote
  #4  
Old October 13th, 2000, 07:54 AM
dragos dragos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 27 dragos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx guys. It really works.

Reply With Quote
  #5  
Old October 13th, 2000, 08:02 AM
dragos dragos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 27 dragos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The default control is rather ugly. The easiest way is to pop up a window and retrieve the url by querystring (I use ASP and it's very easy to do it). I will try other ways also to see which is the best (hidden frame, hidden div).

Reply With Quote
  #6  
Old October 13th, 2000, 10:35 AM
dragos dragos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 27 dragos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0

I found the neatest solution (at least for IE):

<script>
// file is a preprocessed string "serversharepathfile"
function playMusic(file) {
document.all.musicplayer.innerHTML = "<embed src=" + file + ">";
document.all.stopmusic.style.display = "block";
}
function stopMusic() {
document.all.stopmusic.style.display = "none";
document.all.musicplayer.innerHTML = "";
}
</script>

...

<div id="stopmusic" style="display:none;">
<a href="javascript:stopMusic()">Stop Playing</a></div>
<div id="musicplayer" style="display:none;"></div>


Thanks a lot for your help!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > accessing files through links


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT