SchweppesAle Posted October 26, 2009 Share Posted October 26, 2009 Trying to write my code's output to a csv file. However, the following doesn't seem to be working $tmpfname = tempnam("/tmp/", "FOO"); $fp = fopen($tmpfname, 'w'); $write_file = fwrite($fp, $output); fclose($fp); echo var_dump($write_file).'<br>'; echo var_dump($tmpfname).'<br>'; echo '<a href = "'.$tmpfname.'">download</a>'; output: int(7) string(14) "/tmp/FOOGfqKpL" download//it's a link, ii just pasted this in here the link takes you to ourdomain.com/tmp/FOOGfqKpL also, the tmp folder's directory permissions are set to 777 Link to comment https://forums.phpfreaks.com/topic/179079-tempnam-wont-write-to-tmp-directory/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.