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 January 5th, 2005, 08: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
Forcing the name of download, problem !!!

Hi,

I m making a servlet that transfert a ringtone in a celular.
//Servlet UploadContent
File fname = new File(fileToFind);
FileInputStream istr = null;
OutputStream ostr = null;
String contentType=getContentType(fname.getName());
resp.setContentType(contentType);
resp.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\";");
------ Then I make the transfert of the file with Streams

The variable fileToFind come from my JSP :

String path="C:/contenidos2/aquien.mid";
path=URLEncoder.encode(path);
response.encodeRedirectURL("UploadContent?fileToFind="+path);
response.sendRedirect("UploadContent?file="+path);

-----

My problem is :
when path=" C:/folder1/myfile.mid", OK No PB
when path=" C:/Program Files/myfile.mid", Does n t work, the file name who is saved in the cell is the name of the redirection : /UploadContent?file=C:/Program Files/contents/...../aquien.mid

It ignore the variable "name" in :
resp.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\";");
It is the same thing if i put a "test.mid" instead of "name"
I don t know what to do?
I don t know if i explained well, but i hope you have understood
Thanks for attention
Bye, Xoco

Reply With Quote
  #2  
Old January 13th, 2005, 01:37 PM
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
" " = "%20"

poor formatting of a hyperlink..... url encode or remove the space and try
__________________
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
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Forcing the name of 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 4 hosted by Hostway