Hi guys. I have problems with my php scrpt for downloading the file that i uploaded on my wampp server. Specifically, it turns out that when i finished downloding the file, its original size decrease like for example i upload a 24kb file on my wampp server. Then if i try to download this file, the file size turns to 2kb which results on file corrupt.

Why is that happen?

Sometimes it happens that the corrupted file will return the server side error instead of the contents, so you end to download a text file with the wrong extension: jpg, pdf, doc...

Try to open the corrupted file with your editor, if it gives problems then change the extension to .txt and see if you see the error message.

Otherwise check the error log of PHP. If still in doubt share your downloader script.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.