• 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
Re: csv report download -> Safari adding .html to filename?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: csv report download -> Safari adding .html to filename?
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 9 Apr 2009 11:29:04 -0700


On Apr 9, 2009, at 11:19 AM, Leif Harrison wrote:

...still banging my head against the wall on this one. :( I've tried all of the suggestions so far (thank you to all!) but still with no luck.

Should I be using a different subclass other than ERXComponent? (I've tried WOComponent as well, which also did not work.)
Is there some other method I should be implementing or overriding that I'm not aware of?
Some kind of secret-sauce in the .wo? (currently completely empty, since all of the content is generated in appendToResponse)
Some kind of ordering dependency in my calls?


I'm totally stumped at this point...

Have you verified this on more than one machine? I am wondering if you have some preference set in Safari, or some download helper installed. Do other file types work? Is is just csv? What if you tell it is XML (text/xml)? Is that any different?



Chuck


On Apr 6, 2009, at 1:11 PM, Leif Harrison wrote:

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

_______________________________________________ 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

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ 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
References: 
 >csv report download -> Safari adding .html to filename? (From: Leif Harrison <email@hidden>)
 >Re: csv report download -> Safari adding .html to filename? (From: Leif Harrison <email@hidden>)

  • Prev by Date: Re: csv report download -> Safari adding .html to filename?
  • Next by Date: Re: EOEditingContext Lock/Unlock best practice?
  • Previous by thread: Re: csv report download -> Safari adding .html to filename?
  • Next by thread: Re: csv report download -> Safari adding .html to filename?
  • Index(es):
    • Date
    • Thread