New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

PDF assets 404 in both local valet & Ploi

sjclark March 18, 2021 by sjclark

I have a site with a gallery of PDF's, uploaded through a normal asset field. Unfortunately on the front-end they 404 on correct url request.

        <a href="{{ file | url }}" target="_blank" class="block transition-all transform-gpu aspect-w-7 aspect-h-10 hover:scale-105 hover:-rotate-3" alt="{{name}}">
            <img src="{{thumbnail}}" alt="" class="object-cover rounded-xl">

I've tried {{ file }} {{ file|url }} {{ file | all sorts of things }}

(for reference the thumbnail field above loads fine)

They're being saved to a normal (default) assets container, and appear to be properly linked to on the front end - but they always 404. Other (non-pdf) assets within the same container load fine.

assets/general-assets/2020%20programme.pdf doesn't work but assets/general-assets/jpg-in-same-folder.jpg does

The direct link to the file within the Assets section of the admin does not work, but weirdly the "Download File" link does.

I've spent around 2 hours trying to get this to work - same activity on both my local Valet install, and remote Ploi setup (both are essentially default).

title: Assets
disk: assets
allow_uploads: true
allow_downloading: true
allow_renaming: true
allow_moving: true
create_folders: true


        thumbnail: general-assets/Screen-Shot-2021-03-18-at-10.38.36-AM.png
        file: general-assets/2020%20programme.pdf
        name: null

Would really appreciate some help on this one - more than happy to share access to my files.

Answered by sjclark!
>>>>>>> Answered <<<<<<<
1 Reply
1 Follower