title: phpqrcode - save file to temporary directory
body: <p>I'm trying to create a QR-code with the php library <a href="http://phpqrcode.sourceforge.net/" rel="nofollow">phpqrcode</a>.<br></p>
  
  <p>I want to save the file in a temporary file so  I can use it afterwards. Something like <a href="http://phpqrcode.sourceforge.net/examples/index.php?example=005" rel="nofollow">this</a>.</p>
  
  <p>I'm using the Zend Framework and want to use the temporary directory. This is what I have so far:</p>
  
  <pre><code>require_once 'phpqrcode/qrlib.php';
  require_once 'phpqrcode/qrconfig.php';
  
  $tempDir = '/temp';
  
  $fileName = 'test'.'.png';
  
  $pngAbsoluteFilePath = $tempDir . $fileName;
  $urlRelativeFilePath = '/temp' . $fileName;
  
  // generating
  if (!file_exists($pngAbsoluteFilePath)) {
      QRcode::png('http://mylink.com/s/'.$quiz_url, $pngAbsoluteFilePath, 'L', 4, 2);
      echo 'File generated!';
      echo '&lt;hr /&gt;';
  } else {
      echo 'File already generated! We can use this cached file to speed up site on common codes!';
      echo '&lt;hr /&gt;';
  }
  
  echo 'Server PNG File: '.$pngAbsoluteFilePath;
  echo '&lt;hr /&gt;';
  
  // displaying
  echo '&lt;img src="'.$urlRelativeFilePath.'" /&gt;';
  </code></pre>
  
  <p>My output shows: </p>
  
  <blockquote>
    <p>Server PNG File: /temptest.png</p>
  </blockquote>
  
  <p>And an image that can't be found. Can somebody help me on the way?</p>
  
  <p>EDIT:
  When I tried to change the '/temp' to '/temp/' I get this warning: <br></p>
  
  <pre><code>Warning: imagepng(/temp/test.png): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/surveyanyplace/site/library/phpqrcode/qrimage.php on line 43
  </code></pre>
  
  <p><strong>SECOND EDIT:</strong><br>
  When I checked my hard drive I saw that he just saves images on my root map like 'temptest.png'... How can I make sure he save this on temp folder on my server?</p>