且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从MSSQL DB检索的图像文件中缺少部分数据

更新时间:2023-09-27 18:08:04

鉴于您的评论说整个图像 都存储在数据库中,该问题与PHP和/或Web服务器中的数据限制/超时有关.

Given that your comments say that the entire image is being stored in the DB, it's possible that the issue is related to a data limit / timeout within PHP and / or the webserver.

我在此处留下了答案的以下部分以获取历史信息(以展示我们尝试的其他内容),但是请查看以下评论​​,因为该问题更有可能与PHP或网络服务器配置设置有关,限制了响应数据的大小.仍未完全解决.

I've left the following part of the answer here for historic info (to show what else we tried) but please see the comments below, as it's more likely that the issue is related to a PHP or webserver config setting, limiting the size of the response data. Still not fully resolved yet.

我注意到您有一个 Content-type 标头,但没有一个 Content-length 标头.

I notice you have a Content-type header, but not a Content-length header.

您可以尝试添加带有某些任意已知值(例如12288)的 Content-length 标头,并查看这是否会影响返回的文件大小(因为您知道当前的大小为63K-变成12K?)

You could try adding a Content-length header with some arbitrary, known value (e.g. 12288) and see if this affects the size of the file returned (since you know that it's currently 63K - does it change to 12K?)

如果这样做,那么您将需要PHP来计算/找出图像的实际大小,并添加一个具有该长度的Content-length标头.

If it does, then you'll need to get PHP to calculate / find out the actual size of your image and add a Content-length header of that length.