Hi guys, I have following issue:
tempnam (string $dir, string $prefix) function doesn't try to create temporary file in $dir directory, instead it's just put temporary file into system temp folder which is c:\windows\temp.
IIS has all rights to $dir, I know this because fopen() works fine (I can create files with fopen).
I'm using IIS+PHP 5.0.5.
Looking forward for any suggestions!
Incorrect behavior of "tempnam()" function
Moderator: General Moderators
Re: Incorrect behavior of "tempnam()" function
I would suspect that the $dir parameter isn't arriving as expected.
A brief look at the manual page for tempnam and the comments underneath show an issue with relative paths. As per those comments, try the following.
Cheers
A brief look at the manual page for tempnam and the comments underneath show an issue with relative paths. As per those comments, try the following.
Code: Select all
$file = tempnam(getcwd() . $dir, $prefix);