Menu

pdfs do not open, error: file damaged

Help
Geoemyda
2013-03-01
2013-03-03
  • Geoemyda

    Geoemyda - 2013-03-01

    Recently wikindx does not open my attached pfs any more. No matter whether I open them in the browser or download them first, I get an error message.

    However, when I download the files (hashfilename) from the attachements folder via ftp the files open without problems, if I correctly use binary as transfer mode. Using ascii as transfer mode gives the same error message.

    I do not know exactly when this started, nor whether it has always affected the same pdfs. I have a slight feeling, that only pdfs with version 1.6 and higher are affected, not the pdfs with version 1.4, but I am not exactly sure about this. I have only tested this hypothesis for a very small number of files. Could this be?

    My webhoster might have update the php and mysql versions in between. I do not know, if this is correlated with the problem. I am currently using php version 5.2.14.

     
    • Joachim

      Joachim - 2013-03-02

      For what it's worth, I can confirm that 3.8.2 only works with PDF version 1.6 and below. I ran into this problem myself some time ago, and after some experimenting I got this and converted all my attachments to lower PDF versions to avoid those problems.

      Joachim

       

      Last edit: Joachim 2013-03-02
      • Mark Grimshaw

        Mark Grimshaw - 2013-03-02

        Interesting. I can't think of anything I've changed in v4.1 in the file download and open code.

        Anyway, it appears to work in this version.

        Regards,

        Mark

         
  • Mark Grimshaw

    Mark Grimshaw - 2013-03-01

    Hi Geoemyda (long time no see),

    Clearly you can't upgrade to wikindx v4.1 as it requires at least PHP5.3. Which version of wikindx are you using?

    Mark

     
  • Geoemyda

    Geoemyda - 2013-03-01

    Hello Mark,

    your response time is awesome! Thank you!

    I am still using v3.8.2 - I didn't realize version 4.1 is already there.

    Then I think I should update wikindx first (I can switch to php 5.3.8) and hope that this solves my problem. If not I will write here again!

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-03-01

    I'd certainly try that first.

    You will also need to ensure MySQL is up to date. . .

    Then let us know. . .

    Mark

     
  • Geoemyda

    Geoemyda - 2013-03-01

    Hello Mark,

    it worked :-) However, I have another problem with my second database, but I will start a new topic.

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-03-02

    Thanks for the feedback.

     
  • Stephan Matthiesen

    Hi, this may or may not be related, but I noticed that pdfs sometimes have different attachment types in the database. Sometimes (usually) it is application/pdf, sometimes it's application/x-pdf and occasionally even application/unknown.

    It might be possible that files with application/unknown are not recognized as pdf by the browser. Or that they are transferred in a different way (you mention ascii/binary).

    What determines the file type? When I run "file --mime-type *" in the attachment folder, I get all application/pdf.

    Anyway, it might be worth checking what file type is recorded in the DB.

     
    • Joachim

      Joachim - 2013-03-02

      Am 02.03.2013 um 09:55 schrieb Stephan Matthiesen smatthie@users.sf.net:

      It might be possible that files with application/unknown are not recognized as pdf by the browser. Or that they are transferred in a different way (you mention ascii/binary).

      I didn't check the file types back then, but all the PDFs with versions higher than 1.6 couldn't be downloaded or displayed in the browser, until I converted them to 1.4 in Acrobat.

      I can test with 4.2.0 if this is still an issue.

      Best
      Joachim

      --
      Dr. Joachim Trinkwitz E-Mail: jtr@uni-bonn.de
      Institut für Germanistik, Tel.: 0228-737565
      Vergleichende Literatur- www.germanistik.uni-bonn.de
      und Kulturwissenschaft www.comicforschung.uni-bonn.de
      der Universität Bonn 53012 Bonn

       
  • Mark Grimshaw

    Mark Grimshaw - 2013-03-02

    In SVN, I've added a more accurate mime-type discovery when uploading attachments.

    Mark

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-03-03

    It might well be. I'm not sure how to track it down. v4.x requires PHP 5.3 and greater so perhaps the fix is already there.

    Mark

     

Log in to post a comment.