Results 1 to 4 of 4
  1. #1
    5 Star Lounger Lugh's Avatar
    Join Date
    Jun 2010
    Location
    Indy
    Posts
    627
    Thanks
    168
    Thanked 77 Times in 68 Posts
    My shared LAMP server techs reckon this is a browser mime problem, and I use latest IE8 [on Win7], so posting here. I'm not convinced it isn't a server config problem though, with some agreement in the only relevant search result I could find, from Mobileread.

    Problem: File sample.epub is on my server. Customer downloads, and it arrives as sample.zip.

    I can duplicate the issue. Click the sample.epub download link in a webpage, and the standard Windows dialog has it changed to sample.zip in its info text. After download, it's sample.zip on my desktop, and can be opened as a ZIP. It is a good EPUB file, as renaming the file to sample.epub allows it to be opened and read in an ebook reader without problem.

    For those who don't know, EPUB is almost/exactly the same as ZIP, so this problem isn't too bizarre--as mentioned by the folks in the Mobileread thread from a year ago. EPUB is intended to be the MP3 of ebooks, the one standard all devices will support.

    I am able to download EPUB from Project Gutenberg as EPUB without problem. Another PC here on XP SP3 with IE8 gets the same result I do from our server.
    Another staffer in a different location on OSX and Safari does not get the problem, gets a proper EPUB as expected.
    I will have other staffers test within the next day or two.

    If it's allowed/needed, I can put a tiny sample EPUB file on a temp webpage on a spare domain on the same server, if you guys want to play with it.

    My current speculation agrees with one of the Mobileread comments, that the server isn't specifying something properly [that post says mime header], and then IE tries to guess the file type and changes the name accordingly. But I dunno, the detail is beyond my pay grade.

    We sell a lot of ebooks, but have only recently started providing the EPUB format. This will be a major customer service headache if I don't nail it down soon. So thanks for any suggestions you folks can offer.
    Lugh.
    ~
    Windows 10 Pro x64 1607; Office 2016 (365 Home) x32; Win Defender, MBAM Pro

    ASRock H97 Anniversary; Xeon E3-1231V3 (like i7)
    Gigabyte GeForce GTX 970; 12GB Crucial DDR3 1600
    Logitech MX Master mouse; Roccat Isku kb

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    When your web server pushes a download, it can specify a content type and a full file name. It sounds as though you probably are doing that already, because other browsers save under the expected name. But just to be sure, you can check the exact headers using a proxy such as Fiddler (http://www.fiddler2.com/fiddler2/). There also might be a browser add-on for IE to display the headers (for Firefox, you could use Firebug).

    I've never seen IE change a full file name, but if the download does not specify a full file name, IE may sniff the beginning of the file to guess the file type. Users of other browsers often complain that those browsers don't properly detect misnamed filed types.

    Now, why would IE change the .EPUB extension. Is this extension registered on the system as a known extension? I wonder whether it's because it's four letters rather than three? Hmmm...

    Edit: For comparison, Gutenberg is sending the following HTTP header before the .epub file:

    Code:
    Content-Type: application/epub+zip
    Your LAMP techs probably mentioned using a .htaccess file to assign a content type to a file extension, so if you haven't tried this one, go ahead and try it.

  3. #3
    5 Star Lounger Lugh's Avatar
    Join Date
    Jun 2010
    Location
    Indy
    Posts
    627
    Thanks
    168
    Thanked 77 Times in 68 Posts
    Much appreciated JScher, I'll digest and act on your comments, and report back

    Is this extension registered on the system as a known extension?
    Assume you mean on my system. Yes, EPUB is on the Win extensions list and it's assigned a default program to open it too, Mobipocket Reader.

    if the download does not specify a full file name
    It specifies sample.epub. I should mention that EPUB is only one of a number of downloadable files on these pages--eg we also offer PDF, LIT, etc. Funny enough, there's also a legit ZIP offered, it's a package of book file in HTM format + cover art JPG.

    Meanwhile, back at the ranch...

    Another staffer using Firefox got the correct EPUB download, no ZIP.
    Thanks for Fiddler, that showed my server sending "Content-Type: text/plain" for EPUB.
    After reporting this to host support, server tech added...
    AddType application/epub+zip .epub
    ...to .htaccess, which solved the problem. Now I get a clean EPUB download.
    Lugh.
    ~
    Windows 10 Pro x64 1607; Office 2016 (365 Home) x32; Win Defender, MBAM Pro

    ASRock H97 Anniversary; Xeon E3-1231V3 (like i7)
    Gigabyte GeForce GTX 970; 12GB Crucial DDR3 1600
    Logitech MX Master mouse; Roccat Isku kb

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by Brian Boru View Post
    Thanks for Fiddler, that showed my server sending "Content-Type: text/plain" for EPUB.
    After reporting this to host support, server tech added...
    AddType application/epub+zip .epub
    ...to .htaccess, which solved the problem. Now I get a clean EPUB download.
    Great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •