Hi,

Having a strange issue:

I’ve installed a default 8.x Drupal on my GoDaddy-hosted site. On my local Acquia-developed site, I used the Lightning distribution. I can access and use PDF files as images with no problem on my local developed site. Despite bringing in the Lightning modules to my hosted site, I get errors when trying to use a PDF file in an image field.

Not sure why or what I’m missing.

Any clues or starting points for my investigation?

Thanks.

Comments

PragMike’s picture

Added info: The error I get is:

The specified file SomeFile.pdf could not be uploaded.
Only files with the following extensions are allowed: png gif jpg jpeg.

I’ve added the PDF filetype into the allowed file types on the Content Type definition for that field. I notice that Lightning brings u a different file chooser dialog than the one that I get on my hosted site which I assumed had something to do with an installed module, but I can’t seem to determine which module is supplying th specialized dialog box, nor why the select file dialog box should matter if the file type is allowed in the content type definition.

Curioser and Curioser……

Thanks!

jaypan’s picture

Sounds like the upload element is an image upload, when you need a file upload. PDF files are not images, which is why it's being blocked.

Contact me to contract me for D7 -> D10/11 migrations.

PragMike’s picture

Thanks for the response Jaypan.

I’m not sure, but I think it may be more like the other way around - but you set me on the right track - I looked at the actual Add Content screens for each site. The working one asks for a file. The hosted one looks for an image.

The working Add Content screen, from the local version of my site has a button that says “Select Image(s)”. When I click this one I get a dialog that is not the standard file upload - it has a choice of viewing Library or Upload Image.

The broken Add Content screen, from the hosted site has a rectangle (standard add file) dialog with button that says “Add a new file” and tells me below the button that the only allowed types are “png, gif, jpg, jpeg”.

Somehow, I’m getting the wrong button on my Add Content screen and therefore the wrong dialog when clicked.

I’m not sure which module is not doing the display and intercept……