Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

PDF upload gives error Unknown file type not accepted by media

edited November -1 in Installation
I'm on a new host without ffmpeg and am trying to upload pdf files. I keep getting the error "Unknown file type not accepted by media". In a previous post from over 2 years ago, you suggested ffmpeg was needed to process the PDF. Is this still the case, or is something else up? I've attached my admin config page, I do have ghostscript running okay. [attachment=154086,656]

Comments

  • ffmpeg has never been needed for processing of PDFs. Imagemagick was required at one point though.

    It may be an issue with how ImageMagick is identifying PDF files on that server. In app.conf look for the following:

    `

    # If you have ImageMagick or GraphicsMagick installed and PDFs are being inexplicably rejected try setting the corresponding

    # option to 1. It has been observed that ImageMagick chokes on some PDFs. Setting this option will force CA to use Zend_PDF

    # to identify uploaded PDF's, which often resolves the issues at the expense of greater memory consumption.

    dont_use_imagemagick_to_identify_pdfs = 0

    dont_use_graphicsmagick_to_identify_pdfs = 0

    `

    Try setting dont_use_imagemagick_to_identify_pdfs to 1 and then upload a PDF again. Let me know if it works!
  • Yes, cool, that worked fine. Thanks so much for the quick response.
  • I was having the same problem as denbell: "unknown file type not accepted by media" for PDF files. I tried seth's suggestion of setting dont_use_imagemagick_to_identify_pdfs to 1 in the app.conf and that did get the app to take the PDF but no preview images were generated because it says Ghostscript cannot be found.

    However, my server company says Ghostscript is installed. Is there a path to Ghostscript i can set in CA?
  • WCHS: I'm on the trial with Visionhead you suggested, and I had that issue too. They told me to try /usr/share/ghostscript . Well, that is the correct path and it shows in the CA config check as correct, but the preview images still don't work.

    I think there is something wonky with their permission structure, I am having other issues with that as well, i.e.: CA cannot make new directories under "media", even with 777 permissions. I think I am going to be forced to use the DreamHost VPS anyway that I started and pay more, because I really need that ffmeg. Too bad, the VisionHead customer service response time is fantastic as you said!
  • Unfortunately the code that detects if ghostscript is available for the configuration check screen pretty much only checks if the path you set in external_applications.conf exists, not if it's really a ghostscript binary. So there might be a false positive here.

    /usr/share/ghostscript sounds like a directory. You need the path to the ghostscript binary (which is usually called 'gs'). If they prefixed their install with /usr/share/ghostscript odds are the binary is located at /usr/share/ghostscript/bin/gs. But that's just a wild guess.
  • Also, if you have shell access to the server (even if it's very limited), try running a

    which gs

    to find the location of the binary.
  • Thanks to all, after a bit of poking around i finally got it to produce preview images from my PDF file by setting the path in the /app/conf/external_applications.conf to:

    ghostscript_app = /usr/local/bin/gs
  • Denbell, don't give up on getting ffmpeg to work on shared servers; just because they don't have it installed does not mean we cannot run it if we use a precompiled or static build of ffmpeg and upload it to the server. You'll want to look for ffmpeg 32bit Linux static builds of ffmpeg.

    1) Create a directory in your user's home directory (the one above public_html) called, bin. Set permissions of bin to 775.
    2) Upload your precompiled ffmpeg binary to the bin directory and set permissions of ffmpeg file to 775.
    3) Open your /app/conf/external_applications.conf and set an absolute path to ffmpeg like, /home/yourusername/bin/ffmpeg

    Check CA configuration and you'll see it is now available and works. Caveat you have to find a precompiled/static build of ffmpeg that meets your needs: sound or video or both.
  • WCHS: Good work, that ghostscript path worked for me as well in getting PDF previews.

    RE ffmpeg, you make it sound easy ... easy enough that I might even be able to do it. Thanks a lot for outlining the 1, 2, 3 in a way that even someone command-line-challenged like me can understand. I'll definitely give it a shot and start searching for static builds of ffmpeg.
  • Bringing this thread back to life... is there another reason why this could happen?  We have a few (seemingly) random PDFs that cause this error.  The app.conf has been changed with this setting.  This only happens on a handful of PDFs, while most upload without issue.  We are in the process of updating, but I'm curious if there is anything we can do in the meantime.
Sign In or Register to comment.