• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get rid off browser naming conventions

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using a servlet to send an excel file to the browser with the specified name say abc.xls and the browser gives 3 options :
1) open
2) save
3) cancel.

Now when i click open , the browser opens the file in excel like abc[1].xls in IE (6 and 7) and abc-1.xls in Firefox which I dont want . Is there any way to change the append string i.e. [1].

Or do i have to do client side so have to do all the hard work ?

Thanks
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might be useful for you.
 
tanu dua
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rahul.

But I cudn't get what I want it . I am able to get the data in excel and I can open it , save it , so no issues are there except the name that browser uses to open the file .

When say browser gets request to open the file say abc.xsl it will open it like abc[1].xsl (IE 6 and 7) and abc-1(Firefox).This [1] or -1 I dont want in the filename when it is opened.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Content-Disposition header allows you to send the desired name of the file to the browser. There is an example of its use in the FAQ entry that Raul gave you.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought I saw that [1] only when there was already a copy of the file in browser cache, ie the 2nd time I opened it, maybe with the first copy still open. Or did I just guess wrong about what was going on?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic