file download script give me "unknown file size" ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
godsquare
Forum Newbie
Posts: 7
Joined: Tue Aug 12, 2008 11:54 am

file download script give me "unknown file size" ?

Post by godsquare »

Dear All,

I use "File Download 1.3" from http://www.zubrag.com/scripts/ for a while and it work great.

But today, I change my webhosting. The same script give me "unknown file size" instead of file's actually size it used to give me.

I think major factor is the same between 2 webhosting (eg. php version, disable function, etc)

Anyidea how it's happen ? How to solve this issue ?

Here is screenshot

Download from old server
Image

Download from new server
Image

Any suggestion will be appreciated,
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: file download script give me "unknown file size" ?

Post by pickle »

I'm not sure exactly how to fix this, but I think I know the reason why.

Is the file you're downloading being generated dynamically? Is it being run through a proxy PHP file? It's likely that the Content-Length header isn't being sent properly or at all. As a result, the browser doesn't know the total length (size) of the file & therefore can't tell you.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
godsquare
Forum Newbie
Posts: 7
Joined: Tue Aug 12, 2008 11:54 am

Re: file download script give me "unknown file size" ?

Post by godsquare »

pickle wrote:I'm not sure exactly how to fix this, but I think I know the reason why.

Is the file you're downloading being generated dynamically? Is it being run through a proxy PHP file? It's likely that the Content-Length header isn't being sent properly or at all. As a result, the browser doesn't know the total length (size) of the file & therefore can't tell you.
Dear pickle,

Thank you for your answer.

But inn this case, file is exist in the server (not generate dynamically) :cry:
Post Reply