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.

Representation Download results in empty file

Hi!

When I click the download button for a representation in pawtucket I am prompted to save the file but on inspection the file is empty. As far as I can see the blobs in the database are fine. The files are PDFs.
Would be greatful for any advice!

Thanks, Marlies

Comments

  • Hi maja,

    Please look and see that the option download_version is set in your front-end detail.conf file.  PDFs should be downloaded as "original."
  • Thanks for the reply sophie.
    The only detail.conf file I could find was the one in my theme. In this file there was no entry download_version, and adding it didn't solve the problem.
    In media_display.conf I have the following setting:
    download = {
        pdf = {
            mimetypes = {application/pdf},
            display_version = original
        },
    ...


    Where is the content of the file loaded from? Is it the blob in the database?

    What I found out so far is that this line $vn_rc = $this->render('Details/object_representation_download_binary.php'); from the DetailController.php function DownloadRepresentation() returns empty. And also the 'version_path' or media path set above is empty.
    Is it supposed to be like this for PDFs?
  • Sorry I misspoke - the option is found in media_display.conf

    You should have a entry that looks like:

    pdf = {
    mimetypes = {application/pdf},
    display_version = tilepic,
    alt_display_version = mediumlarge,
    width = 400, height = 400,
    download_version = original,
    no_overlay = 0,
    viewer = UniversalViewer
    },
  • Had a look at it again, my media_display.conf file is different than yours.
    I have the version as it is in the master-fix branch of the git project (https://github.com/collectiveaccess/pawtucket2/blob/master-fix/app/conf/media_display.conf)

    Yet everything is set to original for pdf and I did not change things in the conf file so far.
    Is there really a problem with the configuration? As the PDF does download, but without any content.
  • Do they download incorrectly from the backend as well?
  • No, nothing happens when I download the representation in the back end. It simply redirects to an empty page.
    But the download in the back end is a media download (not a representation download), the links are different:

    Back end: editor/object_representations/ObjectRepresentationEditor/DownloadMedia/representation_id/12430/value_id//download/1/version/original
    Front end: Detail/DownloadRepresentation/representation_id/12430/object_id/10993/download/1/version/original

    There is also a media download button for the front end (Detail/DownloadMedia/object_id/10993/representation_id/12430/value_id//download/1/version/original). It results in the same empty page as in the back end.

    To test if the problem only occurs with PDFs I uploaded a picture and tried to download it. In the front end it downloaded fine, in the back end it didn't. I got an empty zip container.
  • I just noticed that if I down load an individual pdf (related representation bundle) it downloads correctly.  If I "Download all media associated with this..." it downloads a very large....but empty zip.

    Here's the file header:
    00000000h: 50 4B 03 04 14 00 08 00 08 00 B7 6E EB 4A 00 00 ; PK........·nëJ..

    which appears correct for a zip.
Sign In or Register to comment.