From: Matthew G. <gr...@mu...> - 2002-03-22 20:44:32
|
Yup, save file popup is what I'm talking about. It probbaly will have to be slightly out of the ESP framework due to headers being sent as James pointed out. --On Friday, March 22, 2002 10:02:17 PM +0200 Roman Jasins <cit...@ma...> wrote: > Matthew, > > are talking about a pop-up window (aka Save File). That's what I was > thinking, but haven't got around implementing. In any case Download is > definitely a feature that people would use, especially those who aren't > UNIX savvy (assuming the ESP is running on a *nix) > > -Roman > On Friday, March 22, 2002, at 09:52 PM, Matthew Gregg wrote: > >> Cool. Since that was done so fast. I can move on to the next change. >> Unless someone objects or has already started it, I would like to add >> "download" to the export function. >> >> --On Friday, March 22, 2002 01:40:10 PM -0500 "James E. Flemer" >> <jf...@ac...> wrote: >> >>> Done. Check out CVS now. I also added a patch to >>> survey_results, to include the "section text" in the >>> results (it was in the merge, but not standard results). >>> >>> -James >>> >>> On Fri, 22 Mar 2002, James E. Flemer wrote: >>> >>>> On Fri, 22 Mar 2002, Matthew Gregg wrote: >>>> > I would like to throw out a possible change to Kon's patch. >>>> Instead of >>>> > having the "section text" indented, have it flush with the question >>>> > numbering. >>>> > >>>> > For example: >>>> > Put the "section text" in the left column and do a colspan="2". >>>> > >>>> > Thoughts? >>>> >>>> +1 : sounds good to me. >>>> >>>> -James >>>> >>>> [ For those not familiar, it's common to just say "+1" or >>>> "-1" for agree or disagree to a suggestion. That makes it >>>> easy to quickly see general opinion. (or we could use >>>> phpesp to acutally "vote". :-p ] >>>> >>>> >>>> _______________________________________________ >>>> phpESP-devel mailing list >>>> php...@li... >>>> https://lists.sourceforge.net/lists/listinfo/phpesp-devel >>>> >>> >>> >>> _______________________________________________ >>> phpESP-devel mailing list >>> php...@li... >>> https://lists.sourceforge.net/lists/listinfo/phpesp-devel >>> >> >> >> >> _______________________________________________ >> phpESP-devel mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpesp-devel > |
From: angek p. <ang...@ip...> - 2002-03-23 04:46:09
|
Hi Guys, I don't think there is a mime type that can be specifically used for csv files, however there is a content-disposition that can be used which basically pops up a save as dialog box (certainly in IE - I use this approach quite often when I don't want the browser displaying the recognised mime types but rather offer to save instead). So here's a possible scenario: Please note that this is not an implementation nor should it be implemented until it is properly tested ....... In the /admin/include/where/export.inc file just after line 144 echo(_('Survey exported as:') . " <tt>$file</tt>"); we add something like this: $file2 = fopen ("download.php","w"); $data = "<?php\n header(\"content-disposition: attachement; filename=$file1\");\n \$file1 = fopen(\"$file\",\"r\");\n fpassthru(\$file1);\n ?>"; $fputs($file2, "$data"); ?> <a href="javascript:void" onClick="window.open('download.php','Download','width=300 height=300')">Download this file</a> <?php The above does 2 things: 1/ writes to a file called download.php which is stored in the /admin/ directory with 666 permissions. This file should have the same group and owner as all the other files in the admin dir. The fpassthru function simply sends the contents of a file to the output stream (in this case your browser window) and closes the file. In IE the content-disposition takes precedence over the fpassthru function and simply offers you to save a html file. Simply entering "name.csv" solves this problem. (and yes, you enter the "" as well :) ) In Netscape I don't think content-disposition works but it will display the csv file content properly formatted to be saved as :filename.csv". 2/ This basically creates a link on the Export Data Page next to "Survey exported as: /tmp/.......csv. Clicking this link will open in a new window (which may contain header info...) the download.php page then (refer to 1). Obviously the above example would need proper error checking code as well........ This is not a complete solution but merely a starting point for further investigation. Kon -----Original Message----- From: php...@li... [mailto:php...@li...] On Behalf Of Matthew Gregg Sent: Saturday, 23 March 2002 7:44 AM To: php...@li... Subject: Re: [phpesp-dev] "section text, etc.. Yup, save file popup is what I'm talking about. It probbaly will have to be slightly out of the ESP framework due to headers being sent as James pointed out. --On Friday, March 22, 2002 10:02:17 PM +0200 Roman Jasins <cit...@ma...> wrote: > Matthew, > > are talking about a pop-up window (aka Save File). That's what I was > thinking, but haven't got around implementing. In any case Download is > definitely a feature that people would use, especially those who > aren't UNIX savvy (assuming the ESP is running on a *nix) > > -Roman > On Friday, March 22, 2002, at 09:52 PM, Matthew Gregg wrote: > >> Cool. Since that was done so fast. I can move on to the next >> change. Unless someone objects or has already started it, I would >> like to add "download" to the export function. >> >> --On Friday, March 22, 2002 01:40:10 PM -0500 "James E. Flemer" >> <jf...@ac...> wrote: >> >>> Done. Check out CVS now. I also added a patch to survey_results, to >>> include the "section text" in the results (it was in the merge, but >>> not standard results). >>> >>> -James >>> >>> On Fri, 22 Mar 2002, James E. Flemer wrote: >>> >>>> On Fri, 22 Mar 2002, Matthew Gregg wrote: >>>> > I would like to throw out a possible change to Kon's patch. >>>> Instead of >>>> > having the "section text" indented, have it flush with the >>>> > question numbering. >>>> > >>>> > For example: >>>> > Put the "section text" in the left column and do a colspan="2". >>>> > >>>> > Thoughts? >>>> >>>> +1 : sounds good to me. >>>> >>>> -James >>>> >>>> [ For those not familiar, it's common to just say "+1" or >>>> "-1" for agree or disagree to a suggestion. That makes it >>>> easy to quickly see general opinion. (or we could use >>>> phpesp to acutally "vote". :-p ] >>>> >>>> >>>> _______________________________________________ >>>> phpESP-devel mailing list php...@li... >>>> https://lists.sourceforge.net/lists/listinfo/phpesp-devel >>>> >>> >>> >>> _______________________________________________ >>> phpESP-devel mailing list php...@li... >>> https://lists.sourceforge.net/lists/listinfo/phpesp-devel >>> >> >> >> >> _______________________________________________ >> phpESP-devel mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpesp-devel > _______________________________________________ phpESP-devel mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/phpesp-devel |
From: Kon A. <ang...@ip...> - 2002-03-23 05:43:58
|
Guys, My apologies for my reply to Matthew's email. sf.net has spat the dummy and refuses to display it correctly so I've resent it to each of you personally. Kon |