Private MP4 files load fine in Chrome and Firefox. However, on iOS Safari (3 different computers in different locations), it shows:
“media error: Format(s) not supported or source(s) not found”
When I remove the rewrite rule from the htaccess file, it works fine on Safari:
RewriteRule ^wp-content/uploads/(private)/(.*)$ /?pucd-folder=$1&pucd-file=$2 [L]
Hi,
First of all, superb plugin. The script handles several file types like PDF, JPG etc. However, what to do with file types that don’t open by default in browsers. For instance, the link just opens a blank page for file types like .docx, .pptx etc.
Please advise.
]]>Hi,
This plugin works pretty fine. I am wondering if an update would be possible. My idea is to assign private files for each users ! Is it possible ?
The problem right now is that a private file might be seen by all selected group of users (and not a specific user).
Thank you
]]>Hello, I’m interested in using this plugin for our websites.
We have password protected pages, so users just type in the password to unlock the page and don’t really sign up or login. On these pages we have links to PDFs which we need to protect. Would the plugin work for this?
Many thanks!
hi Chris,
my client has hundreds of public images which must remain in their current folders, but thousands of private ones are blended into the same folders as the public ones.
is there an automatic way to move these images and avoid manually sifting through each folder and cull out the private ones. very tedious and time consuming to say the least. thanks
]]>Hi Dennis,
I use WordPress 5.1.1, have added the requisite ReWriteRule to my .htaccess file before the BEGIN WordPress block (see below), and copied some test images to wp-content/uploads/private/, both by hand on the server, as well as with Media File Manager plugin.
Problem is, browser (Firefox 66.0.1) does not display any images, and in the admin media interface I also see just grey squares for the images in the folder.
The error message in the browser is (with domain and image the corresponding actual names):
The image “https://<domain>/wp-content/uploads/private/<image>” cannot be displayed because it contains errors.
This happens with all test images, I have checked ownership and permissions. I even moved some images, and then moved them back to their original locations, where I could view them again.
Any pointers would be most welcome! (one example given in “Link to the page you need help with”).
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Block unauthenticated user access to the /private/ uploads folder
RewriteRule ^wp-content/uploads/(private)/(.*)$ /?pucd-folder=$1&pucd-file=$2 [L]
</IfModule>
I’m writing a journal and am very interested in your plugin.
I’ve edited .htaccess using the Apache instructions (using the second option). I moved all my media files on ‘wp-content/uploads’ over to the new private folder ‘wp-content/uploads/private’. Everything appears to be working as it should.
I’m logged in as the admin but unfortunately, my media files aren’t showing up in the media library online or in the WordPress app. They exist in the media library, but there are no preview thumbnails. Clicking on them shows the correct URL, so I don’t know why I can’t see the previews. I have a feeling they aren’t showing up because the files are no longer where they used to be, but I don’t know how to fix it. The WordPress app just endlessly reloads empty squares. https://imgbox.com/EdXwg6lk
I used ‘Search and Replace’ to reindex them, but it didn’t do anything. So I restored my database, and here I am. Is there something I’m missing?
]]>To my surprise, this plugin do not work with mp4 files.
Outside ‘private’-folder i can play my video
Inside ‘private’-folder not
File access using parameters also do not play: ?pucd-folder=private&pucd-file=xyz.mp4
HEADER within private (not working):
HTTP/1.1 200 Connection established
Server: nginx
Date: Mon, 25 Feb 2019 13:00:06 GMT
Content-Type: video/mp4
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding,Cookie
Expires: Mon, 25 Feb 2019 14:00:06 GMT
Last-Modified: Mon, 25 Feb 2019 12:55:28 GMT
ETag: "c984ad2e8a54ce9270403fc66fe953cc"
HEADER outside private (working)
HTTP/1.1 200 Connection established
Server: nginx
Date: Mon, 25 Feb 2019 13:00:40 GMT
Content-Type: video/mp4
Content-Length: 383631
Connection: keep-alive
Last-Modified: Mon, 25 Feb 2019 12:55:35 GMT
ETag: "5da8f-582b774dfbfc0"
Accept-Ranges: bytes
I added 2 lines after
header(‘Content-type: ‘ . $mimetype); // always send this
header('Content-Length: ' . filesize($path)); //NEW
header('Accept-Ranges: bytes'); //NEW
this do not help
Firefox Error in private-folder:
Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006) Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(mozilla::ByteStream *): Cannot parse metadata
TEST-VIDEO MP4:
https://techslides.com/sample-webm-ogg-and-mp4-video-files-for-html5
PS: I use .htaccess – do not know why nginx is shown in header…
?
To my surprise, this plugin do not work with mp4 files.
Outside ‘private’-folder i can play my video
Inside ‘private’-folder not
File access using parameters also do not play: ?pucd-folder=private&pucd-file=xyz.mp4
HEADER within private (not working):
HTTP/1.1 200 Connection established
Server: nginx
Date: Mon, 25 Feb 2019 13:00:06 GMT
Content-Type: video/mp4
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding,Cookie
Expires: Mon, 25 Feb 2019 14:00:06 GMT
Last-Modified: Mon, 25 Feb 2019 12:55:28 GMT
ETag: "c984ad2e8a54ce9270403fc66fe953cc"
HEADER outside private (working)
HTTP/1.1 200 Connection established
Server: nginx
Date: Mon, 25 Feb 2019 13:00:40 GMT
Content-Type: video/mp4
Content-Length: 383631
Connection: keep-alive
Last-Modified: Mon, 25 Feb 2019 12:55:35 GMT
ETag: "5da8f-582b774dfbfc0"
Accept-Ranges: bytes
I added 2 lines after
header(‘Content-type: ‘ . $mimetype); // always send this
header('Content-Length: ' . filesize($path)); //NEW
header('Accept-Ranges: bytes'); //NEW
this do not help
Firefox Error in private-folder:
Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006) Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(mozilla::ByteStream *): Cannot parse metadata
TEST-VIDEO MP4:
https://techslides.com/sample-webm-ogg-and-mp4-video-files-for-html5
PS: I use .htaccess – do not know why nginx is shown in header…
It seems really simple, but I’m stuck on the part about configuring the web server. I don’t know what Apache or Sginx is, or where to configure the server. I’m with Bluehost.
Also I’ve stored my media files here: ‘https://exampledomain.com/example2/example3’, and am wondering if this plugin would still work since it’s no longer stored in ‘/wp-content/uploads’?
]]>Here’s an equivalent rule for Apache to add to your existing rules:
RewriteRule ^wp-content/uploads/(private)/(.*)$ /?pucd-folder=$1&pucd-file=$2 [L]
Or you can copy/paste this entire block into your .htaccess file. Add before the ‘# BEGIN WordPress’ block:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Block unauthenticated user access to the /private/ uploads folder
RewriteRule ^wp-content/uploads/(private)/(.*)$ /?pucd-folder=$1&pucd-file=$2 [L]
</IfModule>
]]>
Hello.
I’m interested to use this plugin, but I use Apache server. Do you know how to configure it?
Thanks.