Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Suggested File Name Problem in Downloading

 
amit sharma
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application client can download reports in excel .I also suggest filename to client based on the parameter like fromdate to todate .My code is
response.setHeader("Content-Disposition","attachment;filename="+reportname);
When the reportname is small it gives the correct filename but when it is large it show something CAG... .How i give the correct filename .
Thanks
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is CAG?
How do you generate the filename.Probably the filename is too big for the OS.Your host OS might not be supporting that long filename.What exact exception/error you are getting.
 
amit sharma
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I not getting any exception file is downloaded properly .CAG..( it contains some more character) is suggested filename when filename is long .Is it possible to reslve this issue.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try to enclose the filename with double quotations ?
How long is your filename exactly ?
 
amit sharma
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want the file name something like this TravelledPathReport_20 Sep 2006 to 21 Sep 2006.
.I enclose the filename with double qoutes but it not works .I use Windows Xp.
Thanks
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make the name seperated by underscore like

TravelledPathReport_20_Sep_2006_to_21_Sep_2006.txt
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic