Page 1 of 1

Problem with time format in filename using content dispositi

Posted: Fri Apr 10, 2015 12:33 pm
by sknarula
Hello,

I am trying to download the excel file and upon downloading the file, the time in file name is changed. Here is the code snippet:

fileName = "XYZ_10-Apr-2015_13:14:52.csv";
header("Content-type: application/x-msexcel");
header("Content-disposition: attachment; filename=\"$fileName\"");
header("Pragma: no-cache");
header("Expires: 0");

However, in the downloads folder, the name of the file is "XYZ_10-Apr-2015_13_14_52.csv". I am trying to figure out the reason why my file name is changed upon download i.e. ":" is changed to "_" in time portion.

Can someone please help with this issue.

Thanks,
SK

Re: Problem with time format in filename using content dispo

Posted: Fri Apr 10, 2015 2:46 pm
by Celauran
You can't use : in a file name