antic
Perch
Hi guys, please help I'm slowly going strange.
I've used the below method to deliver files to the browser before, but with Flash SWF files it's producing strange results. I checked the methodology with MS here:
http://support.microsoft.com/kb/q276488/
The code I use is as follows:
There's a vague similarity with what MS recommends, which is probably my first mistake.
As you can see I've tried two different MIME types to no avail, tried others too, and "" (blank) as well. No matter what I do, instead of the browser running the SWF file as normal, it instead displays the ASCII contents of the file on the screen.
It seems to work fine with all other types of files, and I can drop the SWF file manually into the browser which works fine - so there's nothing wrong with the SWF file itself.
Has anyone had experience with this method and knows any quirks or weirdness I'm not allowing for?
Cheers all!
I've used the below method to deliver files to the browser before, but with Flash SWF files it's producing strange results. I checked the methodology with MS here:
http://support.microsoft.com/kb/q276488/
The code I use is as follows:
Code:
'Response.ContentType = "application/octet-stream"
Response.ContentType = "application/x-shockwave-flash"
Response.AddHeader "Content-Disposition", "attachment; filename=" & sFile
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile sFile
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
As you can see I've tried two different MIME types to no avail, tried others too, and "" (blank) as well. No matter what I do, instead of the browser running the SWF file as normal, it instead displays the ASCII contents of the file on the screen.
It seems to work fine with all other types of files, and I can drop the SWF file manually into the browser which works fine - so there's nothing wrong with the SWF file itself.
Has anyone had experience with this method and knows any quirks or weirdness I'm not allowing for?
Cheers all!