Something might be amiss with the headers -- on my machine it did not recognize an image. It thought it was trying to download a PHP file. Can you please post the rest of the download script?
Main Topics
Browse All TopicsHello experts.
I have a php web application where a user can download a picture. It's been working for years on windows 2003, but now we have moved to windows 2008, and it is not working good. The readfile function doesn't deliver the whole file, it always stops near the end of the file.
Please check the links bellow.
- The first is a direct link to the JPG file, it downloads completely.
http://v1.ativo.com/img_ca
- The second, is a php that uses readfile to send the same file as the first link. It doesn't download the entire file:
http://v1.ativo.com/volks_
What can be wrong?
Thanks a lot
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Tks guys.
The v1.ativo.com DNS record was recently updated. It should point to 209.17.171.46. Please check if your DNS is up to date. You´ll get a 404 error on the old server.
I´ve attached the complete code bellow. It receives a file name on the url, and send the image as an attachment to the user browser, this way the user saves the file, instead of the browser displaying it. This code has worked for years.
Thanks for the help
This is still 404:
http://v1.ativo.com/img_ca
But see the code snippet. Perhaps that will provide some inspiration.
best, ~Ray
Hi, vetrixicode: I just copied the code snippet out of my last post, stored it on my server (Linux) and ran it over the WWW from this desktop computer (WinXP).
It downloaded the JPG perfectly. I opened it in Photoshop and it looks fine - Adobe RGB colors. I like that running outfit!
So the information is accessible over the www, and the data comes through to this machine intact. That suggests that the download script is OK and the file is OK. But it does not isolate the issue completely. It could still be on the server or the client - both are on your end. Maybe you can try running my stored copy of this script (from the Linux server) and see if it works for you. If so, I would look toward the Windows server. If not, it may be your client machine. That's not a foolproof test, but the evidence will be useful. Here is the URL:
http://www.laprbass.com/RA
Best regards, ~Ray
Hmm... Interestingly EE's file uploader does not identify this as a JPG (Possible File Type Mismatch). Perhaps there is something about the file that is acceptable to Linux and Photoshop, but gives Windows a problem? I clicked on the uploaded image in my post above and it came through fine.
What next?
Do you and your office both use the same Internet Service Provider?
We tried to d/l in Safari on a Mac and it said, "Could not open the file, it may be corrupt or a format that Preview doesn't recognize".
We also tried it on a WinXP machine at a different ISP. My colleague said, "It did not work for me. I tried both to open and then save to the desktop and open. It saved to my desktop but it wouldn't open."
So maybe I am the only one who can deal with it?? Anyway, the evidence is beginning to look like the file is defective in some way.
Hi Ray.
My office and home are on different ISPs.
It's strange... it happens to all my files (several thousand) , and the thing is, the same files used to work just fine on my old win 2003 server.
And if the problem was on the file, it wouldn't work on the direct link (without the readfile() function), right? The direct link does work. ( http://v1.ativo.com/img_ca
Script also works on WinXP and WinVista with IE and FF. So if this new script does not work for you, it looks like we may have a bug in Windows 2008. You can test the script from my Linux machine here:
http://www.laprbass.com/RA
HTH, ~Ray
Hi Ray
I've updated the function force_download(), but same results again... it stops.
http://v1.ativo.com/volks_
Thanks
I just used your link and downloaded exactly the same file as I downloaded yesterday, using my link (one post above). The files match precisely, bit-for-bit. In other words, it works.
However it took a VERY long time to download, and the phenomenon was repeatable. I timed it and it took 2:15 to D/L when running the script from v1.ativo.com. In contrast, it took 0:04 when running the script from www.laprbass.com.
Even over HTTP, a 700K image file should download in a matter of a few seconds, at most. I wonder if there is something about the client on your end that is less patient than my client machine? The image came from your server and worked successfully here, whether the script ran on your server or on my server. The only difference was the huge D/L time from v1.ativo.com
Can you get the script at www.laprbass.com to work correctly?
Best regards, ~Ray
Hi Ray, sorry it tookme too long to reply, I was out of town for several days.
Your download was steadly slow, or it was fast at the begining and slow at the end?
What should I test on www.laprbass.com ? PDFs downloaded just fine.
Thanks
From the post above... Try this:
http://www.laprbass.com/RA
There is no way for me to know whether the D/L was steadily slow, etc. It was fast from my server, and slow from ativo.
The link you've sent me worked perfectly, it took me about 3 seconds.
What I meant is, when you downloaded the the file from v1.ativo.com it took 2:15, right? Whatching the download progress bar, can you notice any speed changes? Or the progress bar starts slow, and goes slow to the end?
thanks for your help and persistence
Business Accounts
Answer for Membership
by: nizsmoPosted on 2009-01-13 at 16:54:03ID: 23369069
http://v1.ativo.com/img_ca mpanhas/vo lks_2008/r ds_2474.jp g
This link generates a 404?
Also, your picture seems to download completely OK on my end. What gives you the indication that the download stops before it is completed?