|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
" " = "%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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > Forcing the name of download, problem !!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|