SunQuest
           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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 14th, 2005, 08:58 AM
chheng76 chheng76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 4 chheng76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 4 sec
Reputation Power: 0
WAP download problem

I am developing a ring tones download website. After a
user click a link to download a midi file, the WAP
browser will stay in the current card. Is there any
workaround where the user can go to the next card to
display a download complete message? I am using jsp to
generate wml code.

Reply With Quote
  #2  
Old April 14th, 2005, 10:21 AM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
I don't know anything about jsp but I know form our own download wap site that having the same card on screen is a bonus as you can echo out links you want the customer to click.

The other way of doing it would be to refresh to the content after x seconds then have the downloading of the content update a database, then have another refresh after xx seconds to a script which checks that the updated table value has been modded, if not it redirects back else it shows thanks for your download.,

Apologies if this is garbled but I'm just in a bit of a rush to get some stuff sorted today.

Good luck with it, all the best

Andy
__________________
Andy Moore << oh no it's got a blog.....
Word Press WAP Plugin with Ad Mob Advertising revenue
PHP developer
deploying ringtones, mp3 downloads and realtones
I'm a geek who's obsessed with stats and gadgets

Reply With Quote
  #3  
Old April 14th, 2005, 07:03 PM
chheng76 chheng76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 4 chheng76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 4 sec
Reputation Power: 0
Quote:
Originally Posted by chheng76
I am developing a ring tones download website. After a
user click a link to download a midi file, the WAP
browser will stay in the current card. Is there any
workaround where the user can go to the next card to
display a download complete message? I am using jsp to
generate wml code.


Perhaps I explain more. I wanted to make sure the file is downloaded complete before I jump to a new card say download complete instead of returning to the orginal card with all the download links.

Example:

<wml>
<card id="download">
<a href="song.midi">Song 1</a><br/>
</card>
<card id="complete">
Download complete
</card>
</wml>

How can I jump to complete card after I am sure the user downloaded song.midi instead of returning to download card?

Reply With Quote
  #4  
Old April 15th, 2005, 05:04 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,660 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 4 Days 1 h 21 m 33 sec
Reputation Power: 1618
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
WML can't know whether a file has been downloaded or not. You will need to do a little research into Java to se if you can write a JSP that can redirect after download is complete.

Reply With Quote
  #5  
Old April 18th, 2005, 10:44 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
Quote:
Originally Posted by jabba_29
WML can't know whether a file has been downloaded or not. You will need to do a little research into Java to se if you can write a JSP that can redirect after download is complete.


I am in the same problem,
As for me, you can not do what you want to do... The only way that you can do any operation after the download is using a Direct Download (without link) like this :


protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
String fileToFind = req.getParameter("file");
System.out.println("Parameter:"+fileToFind);
if(fileToFind == null)
{
System.out.println("Error - No parameter");
return;
}
else
System.out.println("parameter OK");

File fname = new File(fileToFind);

if(!fname.exists())
{
System.out.println("el archivo no existe");
return;
}
else
System.out.println("el archivo existe");


FileInputStream istr = null;
OutputStream ostr = null;
String contentType=getContentType(fname.getName());
String name = fname.getName().substring(fname.getName().lastIndexOf("/") + 1,fname.getName().length());
int fileLength=(int)fname.length();

resp.setContentType(contentType);
resp.setContentLength(fileLength);
System.out.println("El tipo del archivo es :"+contentType);
System.out.println("El tamaņo del archivo es :"+fileLength+" Bytes");
System.out.println("El archivo sera guardado como:"+name);
resp.setHeader("Content-Transfer-Encoding", "binary");
resp.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\";");

try {
istr = new FileInputStream(fname);
ostr = resp.getOutputStream();
int curByte=-1;

while( (curByte=istr.read()) !=-1)
ostr.write(curByte);

ostr.flush();
} catch(Exception ex){
ex.printStackTrace(System.out);
} finally{
try {
if(istr!=null) istr.close();
if(ostr!=null) ostr.close();
} catch(Exception ex){
System.out.println("Major Error Releasing Streams: "+ex.toString());
}
}
try {
resp.flushBuffer();
} catch(Exception ex){
System.out.println("Error flushing the Response: "+ex.toString());
}

System.out.println("Transfert Complete !!!");
}

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > WAP download problem


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 | 
  
 





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