GithubHelp home page GithubHelp logo

Comments (8)

conradfuhrman avatar conradfuhrman commented on July 21, 2024 1

Awesome, if you need help, just let me know. We are using the roots.io system so in the sage theme we setup a function in the controller for PDF's. Since we have only one dedicated section of downloads it was easy to isolate. For future implementations we've added an ACF toggle for our client to select a "Download" feature which will run the same function. It could also be improved with the env variables. It's simple, but works :)

function create_download($id, $imgix, $s3) {
//Get the current link based on id from ACF file field
$file = wp_get_attachment_url($id);

//Remove everything past the  querystring including the ?
$file= substr($file, 0, strpos($file, "?"));

//Replace the imgix url with the s3 url.
$file = str_replace($imgix, $s3, $file);

return $file;
}

from ilab-media-tools.

conradfuhrman avatar conradfuhrman commented on July 21, 2024

I have the same issue. I had to write a quick php function to see if a file is pdf and then replace the imxix querystring and link with the S3 one. I haven't looked for a hook or anything within the plugin yet to see if there is an override yet.

from ilab-media-tools.

JulienMelissas avatar JulienMelissas commented on July 21, 2024

@infinitation mind sharing that function and how you used it?

from ilab-media-tools.

JulienMelissas avatar JulienMelissas commented on July 21, 2024

PDFs actually aren't working all-together for us right now, but I'm hoping to take a look at that next week if I can get the time.

from ilab-media-tools.

jawngee avatar jawngee commented on July 21, 2024

from ilab-media-tools.

jawngee avatar jawngee commented on July 21, 2024

Fixed PDF uploads, at least for me ;)

The PDFParser library I was using was dying when parsing. No error, no exception, just died. I updated to the latest version and it has fixed it here.

Fixed PDF urls too.

from ilab-media-tools.

jawngee avatar jawngee commented on July 21, 2024

See commit 22e93a0

from ilab-media-tools.

JulienMelissas avatar JulienMelissas commented on July 21, 2024

The PDFParser library I was using was dying when parsing. No error, no exception, just died.
This is what was happening for me too.

Everything is working for me now since the update. Thank you!

from ilab-media-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.