Jump to content

tempnam won't write to tmp directory


SchweppesAle

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.