This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes JSP and the fly likes special charecters in file name while downloading. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "special charecters in file name while downloading." Watch "special charecters in file name while downloading." New topic
Author

special charecters in file name while downloading.

Khader mohammed
Greenhorn

Joined: Apr 26, 2007
Posts: 2
Hi,

I have a jsp to download files.I get the "page cant be displayed error" if the file name contains the # charecter.

Can some one please suggest the solution.

Thanks in Advance.

Khader.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61995
    
  67

The octothorpe (pound sign) character is a reserved character within a URL (just like ? and &). Be sure that you are URL-encoding your URL components.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Khader mohammed
Greenhorn

Joined: Apr 26, 2007
Posts: 2
Thanks for the reply.
I tried with java.net.URLEncoder.encode() along with using charset as UTF-8.
But now nothing downloads.

Kindly suggest what are steps need to solve this problem.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61995
    
  67

Originally posted by Khader mohammed:
Kindly suggest what are steps need to solve this problem.


Please read this. Can't say much more without details.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: special charecters in file name while downloading.