Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
I get this in console, when open securefile image url directly in a new tab.
GET http://website.com/couch/download.php?a ... 96a9f57c21 net::ERR_CONTENT_LENGTH_MISMATCH

Page opens, picture is already displayed, but the page keeps loading (up to 10-12 seconds) and then spills out the above in console. Used clean browser to check. What's that?
unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
This error would suggest that the size of the file as reported in HTTP response header does not match the actual size of the file.

Does it happen on any particular file? Also are you testing on a local stack? Try rebooting the server and see if it helps.

Please PM me the access creds (FTP+Couch) to the problem site and I'll take a look at the issue, if you wish.

Thanks.
Seems to be a localhost issue.

I prepared a clean setup and it didn't work normally on localhost.

On the live server everything worked fine.

I will monitor this and hope to find what's causing this someday.

Thanks for getting back, appreciate that.
unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
I found that trouble starts when cms:cloak_url is used on securefile images without undocumented parameter thumbnail='1'. Once I introduced it, problems are gone and page loads normally.
unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
General update to this thread. Will show how to really solve this.

Using 'thumbnail'='1' is not a good solution, of course. Sometimes we need images, sometimes we need thumbs.

I spent over 6 hours today, examining all the relevant couch native code. I really had this trouble SO annoying and you'll agree with me if experiences the same. I have found another very old thread about this, but the problem is very randomly showing itself, so I must be lucky.

My troubles included: page loads for 10 sec, image disappears, couldn't download image, concole errors, erroneous file sizes while downloading etc.

So, it appears to root itself in the way localhost systems on *windows* report size of file. Of course, maybe some other thing influenced this, but proper size of file solves everything.

Finally, the solution which is working adequately, which I am happy to share.

/couch/download.php, line 253
Code: Select all
$size = ( $is_thumb ) ? @filesize( $path ) : $rs[0]['file_size'];

Remove the condition and replace it with direct size count of the physical file on disk:
Code: Select all
$size = @filesize( $path );


That helped me and what is basically happened here is that for normal images Couch takes filesize from database and it is not the same as the size on disk. Probably something (windows?, faulty db_update after image processing?) caused it, and for thumbnails filesize was taken from the disk file size instead. So, screw it and get disk size for both types. Immediate releif!

Regards
unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
5 posts Page 1 of 1

Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 9 guests