title: change permission for a file created using tempnam() from 600 to 644
body: <p>How to change the permission of a file that was created by using <code>tempnam()</code> function in php to 0644?</p>
  
  <p>I created some temporary file in <code>/tmp</code> directory using <code>tempnam()</code> and rename that file and changed the location of the file using <code>rename()</code></p>
  
  <p>The renamed file has also permission <code>0600</code>, I need to change that permission to <code>0644</code> for download which was after loading of the webpage.</p>
  
  <p>I tried changing that files permission to <code>0644</code> manually, but once the page was refreshed the permission changed to <code>0600</code>.</p>