• Status New
  • Percent Complete
  • Task Type Bug Report
  • Category Backend/Core
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Low
  • Reported Version 1.0-rc
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray
Opened by peterdd - 24.01.2017
Last edited by peterdd - 24.01.2017

FS#2332 - CSV export filename filtering

The filename for the csv export is build based on project name and current date.

Due different handling of web browsers, the appropriate http header should send the filename in ascii and also provide them as utf-8 for web browsers who can handle that.

Related RFC5987

Project Manager

current playground:

$outfile = sprintf('%s_%s.csv', preg_replace('/[^\d|\w]+/', '_', $proj->prefs['project_title']), date("Y-m-d"));

#$outfileutf8 = str_replace(' ', '_', utf8_decode($proj->prefs['project_title'])).'_'.date("Y-m-d").'.csv';
#$outfileascii = sprintf('%s_%s.csv', preg_replace('/[^\d*|^\w*]+/', '_', $proj->prefs['project_title']), date("Y-m-d"));
#       setlocale(LC_CTYPE, 'de_DE.utf8');
#       $outfileascii = sprintf( '%s_%s.csv', iconv('UTF-8', 'ASCII//TRANSLIT', $proj->prefs['project_title']), date("Y-m-d"));
#} else{
#       $outfileascii = sprintf( '%s_%s.csv', preg_replace('/[^\d*|^\w*]+/', '_', $proj->prefs['project_title']), date("Y-m-d"));

#header('Content-Type: application/csv');
header('Content-Type: text/csv');
#header('Content-Disposition: attachment; filename="'.$outfileascii.'"; filename*=utf-8\'\''.$outfileutf8); # see RFC5987
header('Content-Disposition: attachment; filename="'.$outfile);
header('Content-Transfer-Encoding: binary');

Got this far:

  • Without rfc5987 variant utf8 filenames for download works with firefox, but not IE Edge.
  • With rfc5987 variant utf8 filenames for download works with IE Edge, but not Firefox nor Chrome...
Project Manager

rawurlencode() seems to be our friend ..

quick test works with IE Edge, Firefox, Chrome.


Available keyboard shortcuts


Task Details

Task Editing