Esato Mobile
Sony Ericsson / Sony : GPRS, WAP, MMS and Email setup : WAP dowload in ASP and filename
> New Topic
> Reply
< Esato Forum Index > Sony Ericsson / Sony > GPRS, WAP, MMS and Email setup > WAP dowload in ASP and filename Bookmark topic
DANN Posts: 86

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?
--
Posted: 2002-12-29 14:02:00
Edit : Quote

LadFromWales85 Posts: 88

Mozilla attempts to save the file as 'simpsons.imy.asp'
--
Posted: 2002-12-29 14:24:00
Edit : Quote

DANN Posts: 86

@LadFromWales85

thnx, but do you know the solution ??
--
Posted: 2002-12-29 15:36:00
Edit : Quote

laffen Posts: > 500

It's a T68i thing and has nothing to do with your ASP page. T68 and other phones will save the content (in your case a imy-file) with the name of the script/file (save.asp). To avoid this, you could do what I've done here at Esato with the themes collection. A download link looks like this: http://wap.esato.com/themes/index.php/T68m_Grey.thm?id=15130

The Apache server understand that index.php is a script, and not a directory. It passes the argument "/T68m_Grey.thm?id=15130" to the script. A phone believe "T68m_Gtrey.thm" is the filename, and uses this name when it saves it. It's then up to you how to parse this string and serve out the correct melody.

But then again, it's not sure you can configure your Microsoft server do this.
--
Posted: 2002-12-29 16:06:00
Edit : Quote

DANN Posts: 86

@laffen

Thnx for info. It means my save.asp page has to be named with the name of the ringtone I want to download and then is everything OK. I already tried it and it works

So everytime I want to download something I have to copy save.asp page under name of object for download - e.g. simpsons.asp, make download and then delete simpsons.asp. My wap pages are located on www.brinkster.com which supports ASP and databases ( ASP 3.0 Support (Includes ADO, FileSystemObject)) so I think this is possible way how to solve this download problem, and all objects for download can be stored in db

--
Posted: 2002-12-30 18:39:00
Edit : Quote

New Topic   Reply
Forum Index

Esato home