First of all, I don't know PHP. I'm just starting to learn.
That said, I have some ASP code that I'm using to force a "Save As" dialog box to open when I click a link to an MP3 in a Flash piece (so that the user can download the MP3 to where they want it).
I'm using a querystring to pass the file name/path information to the ASP page, with the variable "music".
How can I convert this ASP code to PHP, because I can't use ASP on with my hosting?
The ASP code is:
<%
const adTypeBinary = 1
Dim sFileName
sFileName = Request.QueryString("music")
Dim objStream, body
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
objStream.Open
objStream.LoadFromFile Server.MapPath(sFileName)
body = objStream.Read
objStream.Close
set objStream = Nothing
Response.AddHeader "content-disposition","inline; attachment; filename=" & chr(34) & sFileName & chr(34)
Response.ContentType = "application/octet-stream"
Response.binarywrite body
%>
Easy to do in PHP?
-watermelonkid