PHP Classes

format non readable

Recommend this page to a friend!

      Handle Binary Files With PDO  >  All threads  >  format non readable  >  (Un) Subscribe thread alerts  
Subject:format non readable
Summary:error with pdf files
Messages:2
Author:Juan F. Gutierrez M.
Date:2018-06-01 02:07:13
 

  1. format non readable   Reply   Report abuse  
Picture of Juan F. Gutierrez M. Juan F. Gutierrez M. - 2018-06-01 02:07:13
Hello. I don´t now what happenn.

The file is recorded in database. but I get message "format non readable". and the file not showed.

what can i do?

thank

Juan Gutierrez

  2. Re: format non readable   Reply   Report abuse  
Picture of zinsou A.A.E.Moïse zinsou A.A.E.Moïse - 2018-06-01 05:36:58 - In reply to message 1 from Juan F. Gutierrez M.
Hello

This is actually not an issue. It is just a message to let the user who is testing the package with the example file, know that i don't handle this case on this page.But this don't prevent you to use the package with PDF files as you may see. The Package has saved as expected the file in the Database so from there, nothing prevent to serve it in the browser. I will show a simple way to serve it in the browser.

Get back to the testHBFWPDO.php file and go to the line 45 .You error message is there

}else{
echo 'format non readable';
}

you can change it by anything you want .

for example

replace only

echo 'format non readable';

by

BFile_WithPDO::get($bdd,$_FILES[ 'file' ]['name'],'header(\'Content-Disposition: attachment; filename="downloaded.pdf"\')');

and test it again with your pdf file.

Let me know if you understand now or if you need more help.