title: PHP-unable to download a .pdf file from database , file content is stored in mysql database
body: <p>i have written a code in php which will echo a pdf file.whenever i am trying to echo that pdf,the browser page is changing into gray colors and the loading icon at the bottom left side corner is appearing and after that it fails to show that pdf file.</p>
  
  <p>what i can assure you that code upto fetching the data from databse is perfect.there is no error or mistake.after fetching the data i have used following headers to echo that file.i am not sure about these headers.</p>
  
  <pre><code>$mimetype = 'application/pdf';
  $disposition = 'attachment';
  header('Content-type: $mimetype');
  header('Content-Disposition: inline; filename="$question"');
  header('Content-Transfer-Encoding: binary');
  header('Content-length: ' . strlen($question));
  header('Accept-Ranges: bytes');
  echo "$question";
  </code></pre>
  
  <p>NOTE: I have used .pdf extension in content-decomposition.but that was not fruitful to me.also used readfile() function and it was also not helpful to me. Can anyone tell me what's wrong there?</p>