Comments (8)
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.
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.
@infinitation mind sharing that function and how you used it?
from ilab-media-tools.
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.
from ilab-media-tools.
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.
See commit 22e93a0
from ilab-media-tools.
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)
- video is not showing on website with cloudflare r2 HOT 2
- Critical error "Uncaught Error: Call to undefined function trailingslashit()" after updating plugin to 4.5.15 HOT 4
- installing premium version via composer: an ETA ? HOT 2
- Incorrect file url, the id is missing from the url
- Filter for images by name so that they are not uploaded to the cloud
- Renamed assets won't upload to Cloudflare R2
- Path of CDN domain is stripped when in private mode (and credential are sent in admin) HOT 2
- Disabling plugin breaks site HOT 2
- Interfacelab is dead, I think
- Image URL is encoded when used with Yoast SEO sitemaps
- Issues after installing PHP 8.2 and MediaCloud HOT 4
- Here are the Errors Media Cloud is creating in WP Engine. How do I fix this.
- Bought your plugin and you have not supported the pro plugin
- Slow site load after plugin activation HOT 2
- Meta value for _wp_attached_file contains site/{siteID} causing issues after direct upload to WP media gallery
- PHP version 8.2.10 compatibility HOT 1
- Disable update custom prefix to _wp_attached_file
- The issue is with creating unnecessary folders HOT 1
- Issue with Creating a Folder in the Root Directory HOT 2
- Mux API error, can't upload videos to Mux. (Or Mux is unable to download video from R2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ilab-media-tools.