Save PDF as a blob in a database using PHP? -


i have pdf file on server want select , transform blob insertion database (using insert into command). first problem getting hold of pdf using php. know done file_get_contents() function, not understand parameters needs.

$fp = fopen($filelocation, 'r'); $content = fread($fp, filesize($filelocation)); $content = addslashes($content); fclose($fp); 

you can save $content blob field in mysql


Comments

Popular posts from this blog

python - RuntimeError: can't re-enter readline -

python - PyInstaller UAC not working in onefile mode -

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -