Re: csv report download -> Safari adding .html to filename?
Re: csv report download -> Safari adding .html to filename?
- Subject: Re: csv report download -> Safari adding .html to filename?
- From: Leif Harrison <email@hidden>
- Date: Thu, 09 Apr 2009 17:25:06 -0700
Okay, so here's an interesting thing...I created a direct action that
returns a pre-configured (to hard-code some login information and
such) version of the response page so that I could test using curl. I
noticed that...if I use that same direct action URL in Safari...I
magically get the correct results, without the .html.
So...does anyone know why Safari would be treating the direct-action
results different than the results from a component action?
- Leif
On Apr 9, 2009, at 3:10 PM, Leif Harrison wrote:
On Apr 9, 2009, at 12:54 PM, email@hidden wrote:
This should be straightforward and with the exception of (1) below,
I don't see any errors. Here's a couple of things to try:
1) you shouldn't be calling super.appendToResponse()
Okay, got rid of that, but still no luck.
2) does reportFilename end in ".csv"?
It does, yes.
3) safari's activity window shows no errors, right?
No errors in the activity window.
4) use curl or tcpdump to look at the response and headers
Here's the output from curl:
Ocelot[15]: curl --verbose 'http://localhost:4700/cgi-bin/WebObjects/MWService.woa/wa/downloadReport'
* About to connect() to localhost port 4700 (#0)
* Trying ::1... Connection refused
* Trying fe80::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 4700 (#0)
> GET /cgi-bin/WebObjects/MWService.woa/wa/downloadReport HTTP/1.1
> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3
OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost:4700
> Accept: */*
>
< HTTP/1.1 200 Apple WebObjects
< cache-control: private
< cache-control: no-cache
< cache-control: no-store
< cache-control: must-revalidate
< cache-control: max-age=0
< content-disposition: attachment; filename=test.csv
< expires: Thu, 09-Apr-2009 21:48:30 GMT
< content-type: text/csv
< pragma: no-cache
< x-webobjects-loadaverage: 5
< date: Thu, 09-Apr-2009 21:48:30 GMT
< content-length: 386
<
Activity Name,Schedule Start,Schedule End
New Activity,2009-04-09 14:32:51-0700,null
New Activity,2009-04-09 14:32:51-0700,null
New Activity,2009-04-09 14:32:52-0700,null
New Activity,2009-04-09 14:32:52-0700,null
New Activity,2009-04-09 14:32:55-0700,null
New Activity,2009-04-09 14:32:56-0700,null
New Activity,2009-04-09 14:32:57-0700,null
New Activity,2009-04-09 14:32:57-0700,null
* Connection #0 to host localhost left intact
* Closing connection #0
Ocelot[16]:
5) make sure your headers are correct and your content really is UTF8
Would there be a better encoding to use for simple csv text output?
- Leif
_______________________________________________
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