Hi everybody,
i have the problem that WordPress cannot use the “file:///servername/folder/file.txt” protocol (‘file:///’) and because of that the SiteOrigin buttons either.
I have made the Intranet Site of a company with the Vantage CMS and noticed that i cannot open files, folders etc. with the file:/// protocol… with smb:// protocol for MAC users everything works absolutely fine.
So can you tell me where and which file i can edit to add ‘file’ to the $protocols?
And how to use it then for the SiteOrigin Buttons?
Thank you very much in advance.
Greetings
Philip
PS: maybe this Thread helps you : https://wordpress.org/support/topic/link-to-local-file
but for me the Plugin unfortunately does not work :-(
Hi Philip
Thanks for your support.
Have you perhaps tried the solution outlined at the end of that thread? Basically saving this as a file: https://gist.github.com/rosshanney/3437658, save as allow-file-protocol.php and then inserting that file under /wp-content/plugins/
Here is that file zipped. You can download and install it via Plugins > Add New > Upload Plugin:
https://siteorigin.com/wp-content/uploads/2014/09/allow-file-protocol.php_.zip
Let me know how it goes.
Hi Andrew,
Yes i already tried it but does not work :-(
in the formations.php the “file” protocol isn’t declared but is it possible that the apache server is blocking it?
do you have any ideas?
thank you for answering :-)
Sorry to hear that’s not working. I did some digging now and unfortunately couldn’t find any better threads on this. I see one or two on Stackoverflow but no answers as of yet. Let me take another look later today and come back to you.
thank you very much for your help! :-)
I found out that in the functions.php the $protocols array is defined and ‘file’ is not filled in.. tried out if it works when i add… and see… the buttons take the file://Y:/servername/folder_/filename.txt but the click event does not do anything… so im on this thing… maybe you find out something more…
thanks in advance
pleased to hear from you
We had another look at the initial plugin you linked to and that I posed a ZIP version of. It should work. Is there any chance that caching on your side perhaps prevented the changes from taking effect? Is there is caching plugin running on your installation?
im running the intranet site via XAMPP. is that a problem?
I’m not sure. This is unfortunately an area I haven’t looked into yet so I’m, by the sounds of it, at a similar level to you in terms of cracking this. It might be worth also popping a question on Stack Overflow to see if you can’t get a better answer there. We’ll certainly help out where we can but unfortunately don’t have anything definitive right now.
thank you very much for your help.
keeping you up to date :-)
For sure, please do let us know how this turns out.
Hey andrew,
finally found the problem and solved it more or less.
The core of my problem is that every Browser blocks the UNC paths for security issues. (like attacks on server through the UNC file:// protocol)
The only browser that allows this UNC file:// path is the IE after handling the security settings.
In Firefox there has to be an adoption in the core files to allow it.
Besides the Plugin we talked above needs to be installed to make sure the SiteOrigin Button or every other Link in WordPress take the file:// URL, if its not installed the wordpress esc_url() function deletes it and replaces it with a http:// URL.
So i can recommend:
To use a Intranet (local) the best way is to have the files directly on that drive to call them via the IP Adress.
In our case we have the XAMPP web server which needs to connect to the Fileserver, but it’s not possible to reach it via IP. For that reason the UNC file:// patch works here in IE.
Thank you for your Help.
Philip
Hi Philip, thanks for coming back to us on this unique challenge. I’m sure users will at some point appreciate this thoughtful feedback you’ve provided.
All the best for your future projects.