WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old December 30th, 2004, 04:30 PM
xoco xoco is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 xoco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 43 sec
Reputation Power: 0
[WAP]download content by redirection to the file

Hi,
I'm trying to make my own WAP server...
For downloading contents, I build a path that can reach a file, like for ex : http://200.56.3.3/Contents/Poly/cansion.mid
and i redirect the client to this path.
The Problem :
It works with the Ericsonn K500i, but it doesn't work with a Motorola C333. It tells me the content cannot be acceded...
But when I proceed differently ( with a link instead of a redirection), it s ok,it download with the motorola....

I guess it has something to do with the WAP version (v1.2.1 and v2), but I don't know how to fix it...
Here is what I've tried : (I use JSP/Tomcat)

I need a redirection a redirection while executing (<jsp:forward...), i don t know why, but with a redir in the compilation (response.sendRedirect), it doesn t work....

I tried do redirect it to another page which set the content type, and the attachment in the header ...
response.setHeader("Content-Disposition","attachment; filename=\""+path+"\"");
This only work with IE.

And I don t have more ideas..........
If you have an idea, please let me know, I d be happy
Thanks
Xoco

Reply With Quote
  #2  
Old December 31st, 2004, 02:01 AM
theloveless theloveless is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 theloveless User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 3 sec
Reputation Power: 0
hey,
me and my friend working on the nearly same subject. The other way to reach the file without link and redirect is to write it binary.

here is the code for ASP hope it helps..

------------------------------------------
filename = "c:\"
filename1 = "a.amr"
Response.ContentType = "audio/AMR"
Response.AddHeader "content-disposition", "attachment; filename=" & FileName1
Set Stream = server.CreateObject("ADODB.Stream")
Stream.Open
Stream.LoadFromFile filename & filename1
Contents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
----------------------------------------------


but the sendredirect is better and i easy to code. i never set content type when sending redirection.

Reply With Quote
  #3  
Old January 3rd, 2005, 10:41 AM
xoco xoco is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 xoco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 43 sec
Reputation Power: 0
Hi,

Thanks for your response, but I don t find a way to write te response in binary in JSP.. But I will look for it, thanks for the idea.



Quote:
Originally Posted by theloveless
hey,
me and my friend working on the nearly same subject. The other way to reach the file without link and redirect is to write it binary.

here is the code for ASP hope it helps..

------------------------------------------
filename = "c:\"
filename1 = "a.amr"
Response.ContentType = "audio/AMR"
Response.AddHeader "content-disposition", "attachment; filename=" & FileName1
Set Stream = server.CreateObject("ADODB.Stream")
Stream.Open
Stream.LoadFromFile filename & filename1
Contents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
----------------------------------------------


but the sendredirect is better and i easy to code. i never set content type when sending redirection.

Reply With Quote
  #4  
Old January 3rd, 2005, 04:08 PM
xoco xoco is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 xoco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 43 sec
Reputation Power: 0
Hi, theloveless,

I found a lot of things thanks to what you ve told me.
Nevertheless, I ve one more question :
Why my technique above (just serve a link until the file) works with the Ericsson K500i, and not with the Motorola C333.
Is it because of the version of WAP (2.0 and 1.2.1)???
Thanks for your help

Quote:
Originally Posted by theloveless
hey,
me and my friend working on the nearly same subject. The other way to reach the file without link and redirect is to write it binary.

here is the code for ASP hope it helps..

------------------------------------------
filename = "c:\"
filename1 = "a.amr"
Response.ContentType = "audio/AMR"
Response.AddHeader "content-disposition", "attachment; filename=" & FileName1
Set Stream = server.CreateObject("ADODB.Stream")
Stream.Open
Stream.LoadFromFile filename & filename1
Contents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
----------------------------------------------


but the sendredirect is better and i easy to code. i never set content type when sending redirection.

Reply With Quote
  #5  
Old January 5th, 2005, 03:13 PM
theloveless theloveless is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 12 theloveless User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 3 sec
Reputation Power: 0
well the first thing that comes to my mind to change the gprs configuration of that phone again.
there is two way of connecting to a wap site as i work on that stuff... first is the services like in nokia and the other one is the browser. i work with a ericsson p900 and couldn't connect to my wap site so i changed the configurations and set them so the default gateway to services become the new ones and my problem is solved. i hope it helps....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > [WAP]download content by redirection to the file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway