上传pdf文件到Mysql服务器

发布于 2024-11-04 18:52:35 字数 208 浏览 5 评论 0原文

我无法上传使用 Photoshop 和 PDFTK 创建的 pdf 文档。其他pdf文档上传没有任何问题。

我收到以下警告:

fread():提供的参数不是

中的有效流资源

警告:fclose():提供的参数 不是有效的流资源

I am unable to upload the pdf documents that are created using Photoshop and PDFTK. Other pdf documents are getting uploaded without any problem.

I am getting the following warning:

fread(): supplied argument is not a
valid stream resource in

Warning: fclose(): supplied argument
is not a valid stream resource

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海夜未眠 2024-11-11 18:52:35

我不建议将 PDF 上传到 MySQL - 您必须将其保存为 BLOB,然后读取 BLOB。这将使您的数据库迅速膨胀并导致速度问题。

相反,请将 PDF 上传到文件系统,并将 PDF 的路径保存在 MySQL 中。然后你可以从 MySQL 读取该路径。

但是,如果您绝对需要将文件保存为 BLOB - 这里有一个很好的教程:
http://bytes.com/topic /php/insights/740327-uploading-files-into-mysql-database-using-php

I wouldn't suggest uploading the PDFs to MySQL - you would have to save it as a BLOB, and then read the BLOB. This will bloat your database quickly and cause speed issues.

Instead, upload the PDF to the file system, and save the PATH to the PDF in MySQL. Then you can read that path from MySQL.

However, if you absolutely need to save the file as a BLOB - here is a good tutorial for doing so:
http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文