Welcome to Esato.com




WAP dowload in ASP and filename

Click to view updated thread with images


Posted by DANN
Hello guys

I'm trying to build small WAP page with download feature (e.g. ringtones in imy format). So I wrote small ASP script which is changing MIME type before sending of file to phone.

In my XHTML WAP page, which is working fine I'm using:

Code:

<a href="save.asp?simpsons">Simpsons</a>



where save.asp looks like:
Code:

<%@ Language=VBScript %><%
Option Explicit

Dim sIMY, sOutput, objIMY, objIMYFile

sIMY = Request.QueryString

If Len(sIMY) > 0 Then
sIMY = Server.MapPath(sIMY & ".imy")
Set objIMY = Server.CreateObject("Scripting.FileSystemObject")
If objIMY.FileExists(sIMY) Then
Set objIMYFile = objIMY.OpenTextFile(sIMY)
Response.ContentType = "audio/imelody"
Response.AddHeader "content-disposition","attachment; filename=simpsons.imy"
Do While Not objIMYFile.AtEndOfStream
sOutput = sOutput & (objIMYFile.Read(1))
Loop
Response.Write(sOutput)
Set objIMYFile = Nothing
End If
Set objIMY = Nothing
End If
%>



The problem is when I click in MSIE at Simpsons link, download dialog appears and offers me right filename - simpsons.imy, BUT when I download this file thru wap browser of my T68i, the melody is always saved with name of ASP script - SAVE. Do you know any solution ??

For my WAP page look at http://www28.brinkster.com/ericssony/

Can anyone give me an advice?


Click to view updated thread with images


© Esato.com - From the Esato mobile phone discussion forum