Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. Agree With Comment Policy. Are you sure this code is legit, I mean when we go to WordPress. Yes the code is legit. When you have a fresh copy of WordPress the. But after you install it, you will find that some more lines are automatically added by WordPress for Proper functioning. It will download a file called index. This happens due to compressing of files by some caching plugin or server.
I hope this helps you, If your problem is solved by this method. Kindly let us know in the comments section. I had faced this problem many time but at the end, it solves automatically, but this it is happening again and again.
For eg. I have the latest version of PHP and everything is up to date. I almost 15 articles on this problem. Please help me out with the solution. Niraj this just worked for me, thanks my friend! I tried a few other fixes that I know of and nothing. Your fix got us back online thanks bunches! Sign Up. Yes, I'm sure. You previously marked this answer as accepted. Are you sure you want to unaccept it? DigitalOcean home. Community Control Panel. Hacktoberfest Contribute to Open Source.
Posted July 18, k views. I set cgi. Add a comment. Subscribe Subscribed. I had same issue. Anyone can help us? Tell me what happens. Submit an Answer Submit an answer.
Sadly, this wrong example is present even in the PHP manual. The author must have been really frustrated and added three Content-Type headers. What would it be like to not having to worry about old versions of Internet Explorer? Note: the quotes in the filename are required in case the file may contain spaces. The code above will fail in IE6 unless the following are added:.
Now, the use of Cache-Control is wrong in this case, especially to both values set to zero, according to Microsoft , but it works in IE6 and IE7 and later ignores it so no harm done.
If you still get strange results when downloading especially in IE , make sure that the PHP output compression is disabled, as well as any server compression sometimes the server inadvertently applies compression on the output produced by the PHP script. Historically it had some performance issues and while the documentation claims there are no memory problems, real-life scenarios beg to differ — output buffering and other subtle things.
Regardless, if you need byte ranges support, you still have to output the old-fashioned way. You just output a header and the module takes care of the rest. This is the source of many seemingly obscure errors. If you have output buffering, the file will not be sent to the user in chunks but only at the end of the script.
At the start of your script, after checking the file if it exists, etc. Be aware that multiple ranges can be specified e. If the range is not valid, you must output. Do not try to guess or fix the range s as it may result in corrupted downloads, which are more dangerous than failed ones. Many developers forget to send the code or the Accept-Ranges. Yet others forget that when you send a range, the Content-Length must match the length of the range rather than the size of the whole file.
0コメント