将PDF上传到WordPress在Local主机上工作,但在带有强大插件的实时服务器上不起作用
我在Localhost中创建了一个WordPress网站。我将其转移到了实时服务器上,但是PDF文档的上传停止工作。我正在使用强大的表单插件。我可以无问题上传.docx和.doc文档。另外,任何其他格式(例如.jpg和.png)也不起作用。
我尝试了什么: - 使用所有其他插件和切换主题。
- 将WordPress置于最新版本6.0-
将其交换到另一个Live服务器。
- 将所有插件填写到最新版本
-ssl&无需SSL-
填写,降级的php版本即可测试
从图像中,您可以看到.pdf和jpg,png显得损坏。
我可以检查什么吗?
工作文档中检查HTML
<img width="48" height="64" src="http://example.com/wp-includes/images/media/document.png"
class="attachment-thumbnail size-thumbnail" alt="" loading="lazy">
从PDFS文档生成的
<img width="106" height="150" src="http://example.com/frm_file/sample-5-pdf-106x150.jpg"
class="attachment-thumbnail size-thumbnail" alt="" loading="lazy">
,但我在上传部分中检查了HTML代码,这是
localhost和localhost和the代码是相同的实时服务器意味着文件正确上传。
但是第一个图像中的HTML代码不同,这导致图像被损坏。看来问题发生在表明已上传文件的占位符图标时。 (在第一个图像中正确显示HTML)
I have a WordPress website I created inside localhost. I transferred it to a live server but the uploads for PDF documents stopped working. I am using the Formidable Forms plugin. I can upload .docx and .doc documents without an issue. Also, any other formats like .jpg, and .png also don't work.
What I have tried:
-Disabling all other plugins and switching theme.
-Updating WordPress to the latest version 6.0
-Switching to a different live server.
-Updating all plugins to the latest versions
-SSL & without SSL
-Upgraded, downgraded PHP versions to test
From the image, you can see that the .PDF and jpg, png appear broken.
Anything I can check?
Inspecting the HTML from the working documents
<img width="48" height="64" src="http://example.com/wp-includes/images/media/document.png"
class="attachment-thumbnail size-thumbnail" alt="" loading="lazy">
HTML generated from PDFs documents that don't work
<img width="106" height="150" src="http://example.com/frm_file/sample-5-pdf-106x150.jpg"
class="attachment-thumbnail size-thumbnail" alt="" loading="lazy">
I checked the HTML code inside the upload section and here is what it looks like
The code is the same inside localhost and the live server meaning the files get uploaded properly.
But the HTML codes in the first image are different which causes the image to be broken. It looks like the problem occurs at the point when the placeholder icons that indicate a file has been uploaded should be displayed. (Correct display HTML in the first image)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的显示肯定是失败的。但是您尚未向我们展示任何证据表明您的上传正在失败,只有您的显示。
屏幕截图上的那些撕裂图标意味着浏览器找不到
&lt; img src =“”&gt;
标签中提到的图像。查看您的浏览器DevTools控制台,看看您是否可以找到有关问题的更多提示。您的第一个IMG标签表示:
SRC URL有两个问题。
http:
。似乎不太可能通过HTTP而不是HTTP提供包含私人个人数据的生产网站。您可能会在控制台日志中收到混合的投诉。路径
/wp-includes/images/media/document.png
。像护照(Passport这样的用户媒体)不太可能存储在WordPress Core Code拥有的目录中。/wp-includes
就是这样的目录。WordPress生成的页面和强大的表单并不参考网站的一部分持有用户包含的PDF上传。但是,对于您的DOC和DOCX上传是正确的。查看IMG标签的图像,这些图像确实有效地提示了这些上传的位置。
Your display is certainly failing. But you haven't shown us any evidence that your uploads are failing, only your display.
Those torn-image icons on your screen shot mean the browser can't find the image mentioned in the
<IMG SRC="">
tag. Look at your browser devtools console to see if you can find any more hints about what is wrong.The first of your IMG tags says this:
That src URL has two problems.
http:
. It seems unlikely that a production web site containing private personal data is served via http rather than https. You may be getting mixed-content complaints in your console log.The path
/wp-includes/images/media/document.png
. It is unlikely that user-furnished media like a passport is stored in a directory owned by WordPress core code./wp-includes
is such a directory.The page generated by WordPress and Formidable Forms is not referring to the part of your site holding user-furnished PDF uploads. But, it is correct for your doc and docx uploads. Look at the IMG tags for the images that DO work to get a hint about where those uploads are stored.