1 <?php 2 require_once 'portabilityLayer.php'; 3 4 if (!sys_get_temp_dir()) { 5 echo "FAIL: No temp dir was returned.\n"; 6 exit(); 7 } 8 9 $tmpFile = sys_get_temp_dir() . "/" . $_GET['filename']; 10 11 if (!file_put_contents($tmpFile, "test")) { 12 echo "FAIL: unable to write to file: " . $tmpFile . "\n"; 13 exit(); 14 } 15 if (!unlink($tmpFile)) { 16 echo "FAIL: Unable to delete file: " . $tmpFile . "\n"; 17 exit(); 18 } 19 ?> 20