Dear All

I have a piece of code

$systemDir = "/usr/local/apache/htdocs";
$outDir ="/upload/files";
$createDir = $systemDir.$outDir;
$outName = "merge3.xls";
$fname = tempnam($createDir, $outName);

When run this produces file with the name merge3.xlsXXXXX where XXXXX is a random(?) string ie merge3.xlsqBliYC

Any ideas why this is happening? I can find no reference to anything in the manual.

    Function tempnam()'s purpose is to create unique filename. Why are you using that if you want to write a file with the name you want?

    Maybe you want to first create the file with tempnam and copy it to your desired directory with desired name?

      Write a Reply...