I have a PDF file on my server that I want to select and transform into a blob for insertion into my database (using an INSERT INTO
command). My first problem is getting hold of the PDF using PHP. I know it is done with the file_get_contents()
function, but I do not understand what parameters it needs.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
$fp = fopen($fileLocation, 'r');
$content = fread($fp, filesize($fileLocation));
$content = addslashes($content);
fclose($fp);
You can save the $content to blob field in mysql