Home All Groups Group Topic Archive Search About
Author
26 May 2005 5:44 PM
Jovo Mirkovic
Hi,

I want to play a MIDI file in browser, but I must give a full path to
WMP control... In that case everyone can simple type full path in
browser and save my midi file... I do not like it... I wont thet they
can listen miti, but that is not possible save it...

How I can do taht in ASP.NET / VB.NET...

Thanks!

Jovo Mirkovic

*** Sent via Developersdex http://www.developersdex.com ***

Author
26 May 2005 6:01 PM
Steve C. Orr [MVP, MCSD]
You can have a special page that acts as a gateway to the file.
Put the midi file in a secured folder, then from within your special page
(after you've determined the user is authorized) use Response.Writefile to
send the midi file to the browser.

Code something along these lines should work:
Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\song.midi")
Response.AddHeader("Content-Disposition", _
"inline;filename=song.midi")
Response.End()

Here's more info on Response.WriteFile
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpresponseclasswritefiletopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


Show quoteHide quote
"Jovo Mirkovic" <nospam@sezampro.yu> wrote in message
news:%23s2GIqhYFHA.3188@TK2MSFTNGP09.phx.gbl...
>
> Hi,
>
> I want to play a MIDI file in browser, but I must give a full path to
> WMP control... In that case everyone can simple type full path in
> browser and save my midi file... I do not like it... I wont thet they
> can listen miti, but that is not possible save it...
>
> How I can do taht in ASP.NET / VB.NET...
>
> Thanks!
>
> Jovo Mirkovic
>
> *** Sent via Developersdex http://www.developersdex.com ***
Author
26 May 2005 6:35 PM
Jovo Mirkovic
Thanks Steve!

*** Sent via Developersdex http://www.developersdex.com ***
Author
27 May 2005 11:12 PM
Mythran
"Jovo Mirkovic" <nospam@sezampro.yu> wrote in message
news:OKXGpGiYFHA.3152@TK2MSFTNGP14.phx.gbl...
>
> Thanks Steve!
>
> *** Sent via Developersdex http://www.developersdex.com ***

Not sure you know this...:

Fictional Situation :

1.) I am a hacker.
2.) You place the file on the server and have a page write the file to the
client:
3.) I write a program that requests this page and saves it to a file.

Purpose Defeated.

Anywho, the answer is, if someone can listen to it remotely on their
machine, then it can always be saved to disk.  I don't like that as much as
anyone else, but it is the truth...for now...

Mythran
Author
29 May 2005 6:13 AM
Steve C. Orr [MVP, MCSD]
This is why I specified that he allow the file to be downloaded only after
he's authenticated the user.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


Show quoteHide quote
"Mythran" <kip_potter@hotmail.comREMOVETRAIL> wrote in message
news:eYrObGxYFHA.3300@TK2MSFTNGP14.phx.gbl...
>
> "Jovo Mirkovic" <nospam@sezampro.yu> wrote in message
> news:OKXGpGiYFHA.3152@TK2MSFTNGP14.phx.gbl...
>>
>> Thanks Steve!
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>
> Not sure you know this...:
>
> Fictional Situation :
>
> 1.) I am a hacker.
> 2.) You place the file on the server and have a page write the file to the
> client:
> 3.) I write a program that requests this page and saves it to a file.
>
> Purpose Defeated.
>
> Anywho, the answer is, if someone can listen to it remotely on their
> machine, then it can always be saved to disk.  I don't like that as much
> as anyone else, but it is the truth...for now...
>
> Mythran
>
Author
31 May 2005 4:25 PM
Mythran
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:e5$I6VBZFHA.2400@TK2MSFTNGP10.phx.gbl...
> This is why I specified that he allow the file to be downloaded only after
> he's authenticated the user.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>


Yes, you are right :)

Mythran