|
From: Matthew G. <gr...@mu...> - 2002-03-26 18:29:48
|
Yeah. Moving the logic into download.inc is much better. I was hesitant
to go that route.
One slight change to download.inc.
- header("Content-Disposition: attachment; filename=$\"name.csv\"");
+ header("Content-Disposition: attachment; filename=$name.csv");
That fixes the extra "'s that show up in Konq. and Windows IE.
application/x-csv looks like the way to go.
What do you think of appending date/time to the exported filename and maybe
a check for empty results before download/export?
--On Tuesday, March 26, 2002 11:55:44 AM -0500 "James E. Flemer"
<jf...@ac...> wrote:
> I've modified your patch a little bit. Take a look and see
> what you all think. It allows people to still export data
> to a file, and also download it. I also changed the content
> type to "application/x-csv" since "text/plain-text" is not
> a real content type (and when it is "text/plain" it shows
> inline, not a save as box). We could also try
> "application/x-msexcel", tho I believe there is another
> preferred type for Excel.
>
> -James
>
> On Mon, 25 Mar 2002, Matthew Gregg wrote:
>
>> Since I didn't get any feedback on this idea, I went ahead an created the
>> attached patch against current CVS.
>>
>> I'm sure it's lacking somewhere so...comments?
>>
>> --On Saturday, March 23, 2002 10:09:27 AM -0500 Matthew Gregg
>> <gr...@mu...> wrote:
>>
>> > I've got this roughed in and working.
>> > I'm getting around headers/data being sent as follows:
>> > In export.inc on the CSV download url, I'm adding another parameter
>> > that is used in manage.php and when export.inc is called later to
>> > bypass any headers or data being sent.
>> >
>> > At your suggestion I split survey_export_cvs() into survey_export_cvs()
>> > and survey_generate_cvs()
>> >
>> > As for as mime types:
>> > I'm considering "application/x-msexcel" or "text/plain-text". We've
>> > used x-msexcel before to "trick" excel into opening tab delimited text
>> > files. Not sure how it will work for csv.
>> >
>> > How's this sound?
one of the friendly folks in the IT Lab.
--------------------------------------\
The IT Lab (http://www.itlab.musc.edu) \____________________
Probably the world's premier software development center.
Serving: Programming, Tools, Ice Cream, Seminars
|