Plugin development, downloading updates via API link
-
Hey,
I have a plugin that receives updates from a file on my server and it works great.
I use – https://github.com/YahnisElsts/plugin-update-checker
My problem is when I try to change the file link to a masked link the update fails. The link behaves like a downloadable file but in practice it fails.
for example:
https://example.com/download/file.zip – works great
https://example.com/wp-json/my-end-point/v1/download – does not work
I added the headers:header("Content-Type: application/octet-stream"); header('Content-Type: application/zip'); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename=\"file.zip\""); readfile('https://example.com/download/file.zip');When you enter the link https://example.com/wp-json/my-end-point/v1/download, the file downloads properly through the browser.
The idea is that I can verify before downloading the file
How can I solve this?
The topic ‘Plugin development, downloading updates via API link’ is closed to new replies.