• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
csv report download -> Safari adding .html to filename?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

csv report download -> Safari adding .html to filename?


  • Subject: csv report download -> Safari adding .html to filename?
  • From: Leif Harrison <email@hidden>
  • Date: Mon, 06 Apr 2009 13:11:36 -0700

Hey guys,

Has anyone run into issues with Safari tacking on ".html" to filenames when attempting to do attachment downloads? (CSV data, in this case.)

I can't for the life of me figure out how to get Safari to just use .csv as the file extension.  Firefox, of course, works just fine...

Here's my current appendToResponse (it's pretty simple, at the moment):

public void appendToResponse(WOResponse response, WOContext context) {
log.debug("appendToResponse()");


        super.appendToResponse(response, context);

try {
fetchActivities();
String report = generateReport();
log.debug("  report = " + report);


response.setContent(report);
response.setStatus(WOMessage.HTTP_STATUS_OK);

response.setContentEncoding("UTF8");
response.setHeader("attachment; filename="+reportFilename,"Content-Disposition");
response.setHeader("text/csv", "Content-Type");


} catch (Exception e) {
System.out.println("Error Downloading file: " + e);
}
}

- Leif

----------
Leif Harrison
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: csv report download -> Safari adding .html to filename?
      • From: Leif Harrison <email@hidden>
    • Re: csv report download -> Safari adding .html to filename?
      • From: David Holt <email@hidden>
    • Re: csv report download -> Safari adding .html to filename?
      • From: Mark Morris <email@hidden>
    • Re: csv report download -> Safari adding .html to filename?
      • From: John Huss <email@hidden>
  • Prev by Date: [JC] EODistributionChannel.Delegate and session expiration
  • Next by Date: Building on server, no Eclipse
  • Previous by thread: [JC] EODistributionChannel.Delegate and session expiration
  • Next by thread: Re: csv report download -> Safari adding .html to filename?
  • Index(es):
    • Date
    • Thread