title: Saving file into a prespecified directory using FPDF
body: <p>I want to save the PDF file into a user specified directory. I am using FPDF. And the code is as below:</p>
  
  <pre><code>&lt;?php
  //echo "&lt;meta http-equiv=\"refresh\" content=\"0;url=http://www.train2invest.net/useradmin/atest_Khan.php\"&gt;";
  require('fpdf.php');
  
  //create a FPDF object
  $pdf=new FPDF();
  
  //set font for the entire document
  $pdf-&gt;SetFont('times','',12);
  $pdf-&gt;SetTextColor(50,60,100);
  
  //set up a page
  $pdf-&gt;AddPage('P');
  $pdf-&gt;SetDisplayMode(real,'default');
  
  //Set x and y position for the main text, reduce font size and write content
  $pdf-&gt;SetXY (10,60);
  $pdf-&gt;SetFontSize(12);
  $pdf-&gt;Write(5,'Dear Ms.XYX');
  
   $filename="test.pdf";
  //Output the document
  $dir = "/G:/PDF/test.pdf/"; // full path like C:/xampp/htdocs/file/file/
  $pdf-&gt;Output($dir.$filename,'F');
  ?&gt;
  </code></pre>
  
  <p>Now even if I put <code>"G:\PDF\"</code> in the filename it doesn't save it!! I have tried the following:</p>
  
  <pre><code>$filename="G:\PDF\test.pdf";
  $pdf-&gt;Output($filename.'.pdf','F');
  
  
  $filename="G:\\PDF\\test.pdf";
  $pdf-&gt;Output($filename.'.pdf','F');
  
  $filename="G:/PDF/test.pdf";
  $pdf-&gt;Output($filename.'.pdf','F');
  
  
  $filename="/G:/PDF/test.pdf/";
  $pdf-&gt;Output($filename.'.pdf','F');
  </code></pre>
  
  <p>I have checked that the directory i am trying to write has write/read permission and it's there. IT STILL DOESN'T WORK!</p>
  
  <p>PLEASE help somebody... </p>