Hej! Beror antagligen på inställingar i Media Player.Det du kanke kan göra är att sända Binerydata.kolla i forumet hur man gör.var uppe andeles nyligen hbua m,an gjorde så det borde inte vara så svårt att hitta. Testa följande kod:Spara ner en fil (Request.Querystring)
Vissa datorer sparar ner, andra öppnar låten direkt via Media player.
Efter lagrad info i databasen skickas man direkt till:
Response.Redirect "http://www.minsida.com/musik/" & Request.Querystring("song") & ""
Hur gör jag för att alla skall kunna spara ner filen utan att behöva högerklicka o välja spara som osv, och varför kan vissa spara ner den direkt medan andra inte?
Mvh HassanSv: Spara ner en fil (Request.Querystring)
Sv: Spara ner en fil (Request.Querystring)
<%
Response.Expires = 0
''''''''''''''''''''''''''''''''''''''''''''''''''
' The function that serves the file specified
' by the path
''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ServeFile( filepath )
Dim mimes, objStream, strFilePath, fname, extension
' Set mime types
Set mimes = Server.CreateObject( "Scripting.Dictionary" )
mimes.Add "mdb" , "application/vnd.ms-access"
mimes.Add "doc" , "application/msword"
mimes.Add "pdf" , "application/pdf"
mimes.Add "xls" , "application/vnd.ms-excel"
mimes.Add "ppt" , "application/vnd.ms-powerpoint"
mimes.Add "js" , "application/x-javascript"
mimes.Add "zip" , "application/zip"
mimes.Add "jpg" , "image/jpeg"
mimes.Add "jpeg" ,"image/jpeg"
mimes.Add "gif" , "image/gif"
mimes.Add "tiff" ,"image/tiff"
mimes.Add "tif" , "image/tiff"
mimes.Add "gzip" ,"multipart/x-gzip"
mimes.Add "html" ,"text/html"
mimes.Add "htm" , "text/html"
mimes.Add "txt" , "text/plain"
mimes.Add "java" , "text/plain"
mimes.Add "rtx" , "text/richtext"
mimes.Add "css" , "text/css"
mimes.Add "wav" , "audio/x-wav"
mimes.Add "mpeg" , "video/mpeg"
mimes.Add "mpg" , "video/mpeg"
mimes.Add "mpe" , "video/mpeg"
mimes.Add "qt" , "video/quicktime"
mimes.Add "mov" , "video/quicktime"
mimes.Add "xml" , "text/xml"
' Get the filename part only
fname = Mid( filepath, InstrRev( filepath , "\" ) + 1, Len( filepath ) )
' Get the file extension
extension = Mid( fname, InstrRev( fname, "." ) + 1 )
extension = Lcase( extension )
' Create object and set properties
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
IF mimes.Exists( extension ) Then
Response.ContentType = mimes.Item( extension )
Else
Response.ContentType = "application/octet-stream"
End IF
' Set the filename
Response.AddHeader "Content-disposition", "Attachment;filename=" & fname
' Load from file
objStream.LoadFromFile filepath
' Write file to buffer
Response.BinaryWrite objStream.Read
' Flush file to client
Response.Flush
' Clean up
objStream.Close
Set objStream = Nothing
Set mimes = Nothing
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''
' IMPORTANT: No output must be made before the
' call to ServeFile since it will handle all the response.
' ( You can only have one response per request )
''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the ServeFile sub with the file you want to serve
ServeFile( Server.MapPath( Request("fil") ) )
%>