Our products are eBooks, delivered in both .epub and .mobi formats via the http://www.tipsandtricks-hq.com/ eStore Plug-in for WordPress which generates encrypted download links.
Problem began suddenly about 5 days ago and had previously worked fine for about three months
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 encrypted 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/foo/bar/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? Here is an example of the encrypted link:
https://fu.com/bar/download.php?file=LRtro6WQMN12ip%2BEcL0TYS8sMZmSKOlkRedVCZyfACsqSllzCAjDp%2FZJyfQ2oq0ZP6vg1EMrR%2FOFC4B3wGDHl3N0u0sulcBhIfkOJ0C0UQh6
And here is a look at the http header:
Status: HTTP/1.1 200 OK
Date: Wed, 27 Feb 2013 14:55:47 GMT
Server: Apache
X-Powered-By: PHP/5.3.17
Set-Cookie: PHPSESSID=7d61c9dd6ecbd321bea8cffg4a25d5e8; path=/
Expires: 0
Cache-Control: public
Pragma: public
X-CF-Powered-By: WP 1.3.9
Content-Description: File Transfer
Content-Disposition: attachment; filename="Some-File-Name-Which-Was-Replaced.epub"
Content-Transfer-Encoding: binary
Content-Length: 5088032
Connection: close
Content-Type: application/epub+zip
What else could possibly be causing this? Could our server be forcing ASCII in .htaccess or apache config settings?
Thank you very much