Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › eStore – File Downloads Corrupted
Tagged: EF BB BF, file corruption, UTF-8
- This topic has 10 replies, 3 voices, and was last updated 11 years, 8 months ago by ishmaelangelo.
-
AuthorPosts
-
February 27, 2013 at 1:08 pm #8653ishmaelangeloMember
Our products are eBooks, delivered in both .epub and .mobi formats via the eStore generated download links.
– Problem began suddenly about 5 days ago
– all .epub files get corrupted when customers download their purchase via the download links and Adobe Digital Editions gives an error when trying to import the ePub to the Library
– all .mobi files get corrupted when downloaded and then loaded onto Kindle, Kindle gives similar error
– we tried turning off the Google URL shortener, error
– we have tested the links with IE, Chrome and Firefox, error
– we tested without the encrypted links, by downloading the files via a direct link in the browser and they work fine, no error
What we have learned:
– we have tested using FTP to download in both ASCII and Binary modes … with ASCII we get the same error as with using the download links
– files transfered with FTP are the same size after using ASCII and Binary, but running a hash check shows that the contents are different
– we are using FileZilla to test via FTP on both PC and Mac, however the error only occurs on the PC
– SO, we are assuming that this problem has to do with the file transfer type and PCs
– in /home/*****/*****/wp-content/plugins/wp-cart-for-digital-products/download.php we see header(“Content-Transfer-Encoding: binary”); so we assume that Binary is being forced when using the encrypted links
Could there possibly be some characters in the encrypted link string that are forcing ASCII?
What else could possibly be causing this?
Thank you very much
February 27, 2013 at 2:06 pm #54102wzpModeratorHave you tried a different download method?
Have you enabled the debug logsd, and checked for messages in the download_manager_debug.log file?
Has anything about your settings, or your hosting service, changed recently?
Please review this rather extensive thread on the subject…
https://support.tipsandtricks-hq.com/forums/topic/downloaded-file-size-is-0-zero-byte
February 27, 2013 at 8:47 pm #54103ishmaelangeloMemberwzp, thanks
We went through all of the items in the checklist, but to no avail. Still having corrupted files.
We tried a different download method.
The debug logs looks normal, the same now as they were before the error started occurring
We sent a ticket to our web host asking if anything has changed and they said no
In the post it says: “If the above steps do not fix the issue you are having please contact us and we will take a close look at your site.”
What do you need to take a closer look at our site?
Thank you
February 27, 2013 at 9:06 pm #54104ishmaelangeloMemberWe just tried looking at the corrupt file vs the working file with a Binary Editor and found that there is junk data at the beginning of the corrupt file. (Per this tip here: http://stackoverflow.com/questions/4465135/php-file-download-is-always-corrupt-50-of-the-time)
What could be the source of the junk data at the beginning of the file?
February 27, 2013 at 9:19 pm #54105ishmaelangeloMemberWe converted the binary to ascii and found that the junk data at the beginning of the file is: ï°¿
Which are HTML Codes for:
¿ = inverted question mark
° = degree sign
ï = latin small letter i with diaeresis
Now we are trying to figure out where the heck this is coming from!
From the eStore plug-in? From the server? From Windows (because it only happens on Windows)?
February 27, 2013 at 9:30 pm #54106ishmaelangeloMemberWow. This post is showing a similar problem. The guy was using eStore successfully, and then suddenly it stopped working and the files were getting corrupted:
https://support.tipsandtricks-hq.com/forums/topic/digital-download-file-corrupted/page/2
February 27, 2013 at 10:21 pm #54107wzpModeratorSo, did trying something like Method 7 (Curl) change anything? Is your server using gzip to compress any of the data being sent to the browser?
A plugin usually never suddenly stops working. Something somewhere had to change to trigger it. If you check this post it will explain more on this:
https://support.tipsandtricks-hq.com/forums/topic/my-plugin-just-stopped-working
February 28, 2013 at 5:00 pm #54108ishmaelangeloMemberrepeated send to server, see post below
February 28, 2013 at 5:01 pm #54109ishmaelangeloMemberWe reverted our VPS to 10 days prior yet the problem is still occurring. Setting up on a different host now to test there.
Since others have had this problem as well, do you think it is possible that something in the database related to this plug-in is causing the problem? Maybe something got corrupted in the database.
If we uninstalled and then reinstalled the eStore plug-in, would all the eStore related database entries be cleared out?
ALSO, HOW CAN WE TURN OFF THE ENCRYPTED LINKS? We would be fine just giving our customers direct access to the downloads for now, and then change the URLs once this problem is fixed.
Thanks
February 28, 2013 at 11:21 pm #54110adminKeymasterHi, This issue always happens from a configuration issue on the server. I would like to take a look at the settings on your site. I have sent you an email to get access to the site so I can check it out.
Update: The mail I sent to you bounced back from your server. Gave me the following error:
Google tried to deliver your message, but it was rejected by the server for the recipient domain progressiveapps.com by mx1.sub5.homie.mail.dreamhost.com
Please fill out out contact from (use an email address that is not on your server so we can reply back to you… it is likely there is another issue there too).
March 1, 2013 at 3:47 pm #54111ishmaelangeloMemberOne of our programmers was using the wrong character encoding in his editor. We need to treat PHP files with the UTF-8(BOM off) or blank spaces or newlines can interefere somehow in the file integrity:
[http://stackoverflow.com/questions/2558172/utf-8-bom-signature-in-php-files]
Offending line of code in WordPress’ functions.php: if ($bom != b”xEFxBBxBF”)
Our culprits, remember: EF BB BF
They appeared in the beggining of the corrupted .epub files.
So glad we finally got to the root of the problem, was driving us mad! Ha haa!!!
Thank you very much for your support, eliminating possibilities helped us get to the source of the problem.
Peace & Happy Coding to You
-
AuthorPosts
- You must be logged in to reply to this topic.