"Temporarily unavailable error while unlinking tempnam"
P粉309989673
P粉309989673 2024-03-28 17:16:11
0
1
406

I want to unlink (delete) my temporary file but php throws the error:

Warning Error: Unlinking ("my file path"\Temp\TMPAF91.tmp): ["my file path"\myscript resources in Temporarily unavailable.php, line "number"]

$tmpfile = tempnam(sys_get_temp_dir(), 'zipfile');

file_put_contents($tmpfile, $content);

$zip = new ZipArchive;

if ($zip->open($tmpfile) === true) {
// my code in here to extract the $content of the $tmpfile

  $zip->close();
} 



unlink($tmpfile);

I'm not sure what's going on here. ZipArchive is down, so I should definitely be allowed to unlink.

P粉309989673
P粉309989673

reply all(1)
P粉085689707

This error only occurs on my Windows computer (version 10 in Mamp settings).

On my Linux server (Debian Jessie distribution). This works very well.

It also works fine on my Mac (Catalina in Mamp settings).

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template