Syntax of <a rel="nofollow" class="external" href="file://///networkwithaccess/myfolder/myfile.doc"> not downloading document in Chrome, Edge but works in IE11
I am using in Windows server:
MediaWiki 1.35.2
Apache 2.4.47 Win64 from Xampp
mysql-8.0.23-winx64 (MySQL :: Download MySQL Community Server)
PHP 7.4.3
In the source code of Mediawiki, I have code as below:
<ul><li><a rel="nofollow" class="external text" href="file://///networkwithaccess/myfolder/myfile.doc">This is my file</a></li>
When I click on it, it does nothing, and certainly does not open/download the file (Microsoft-Word document).
However, from the same machine (where I am trying to open it from mediawiki link), I can successfully open (download) the file by typing the following in the browser. When I type the following in the browser, the myfile.doc downloads
file://networkwithaccess/myfolder/myfile.doc
However, from the MediaWiki link, it does not download. The link in mediawiki shows it as a link (with a rectangle and arrow symbol at the end of the link). But clicking on it in Mediawiki does nothing.
I also have the correct setting in LocalSettings.php as:
# File Link Protocols configuration $wgUrlProtocols = array( 'http://', 'https://', 'ftp://', 'irc://', 'gopher://', 'telnet://', // Well if we're going to support the above.. -var 'nntp://', // @bug 3808 RFC 1738 'worldwind://', 'mailto:', 'file://', 'news:' );
array_push($wgUrlProtocols, "file://");
$wgPFEnableStringFunctions = true;
In httpd.conf, I have:
<Directory />
AllowOverride all
Require all granted
</Directory>
My .htaccess is:
<IfModule rewrite_module>
RewriteEngine On
RewriteOptions inherit
# Fix for bug T64289
Options +FollowSymLinks
</IfModule>
I did NOT do anything else related to Template:Unc, nor I downloaded anything extra. All I have done is the above. Nor, I understand where to look for Template:Unc.
Now, with the above setting, the file successfully downoads in Internet Explorer11, but it does NOT in Microsoft-Edge, Chrome, Mozilla browsers.
In Chrome, when I click on that link, it gives the error in the developer console as:
Not allowed to load local resource:
I have also closed all the Chrome instances and opened a new instannce of Chrome browser using:
Can you please advise what I need to do to make this link download the file from MediaWiki? Or, does MediaWiki download it silently in a directory? I do not have any directory as such configured in the LocalSettings.php. But if it indeed downloads it silently in my local machine, how to verify from any settings?
The MediaWiki runs in a different Windows server and I open it from a browser in my personal Windows machine. From my personal Windows machine, I can open the file from browser using the file:// syntax. On the contrary, from the personal machine, when I click on the link in MediaWiki, no download happens.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
userapache123
I am using in Windows server:
MediaWiki 1.35.2
Apache 2.4.47 Win64 from Xampp
mysql-8.0.23-winx64 (MySQL :: Download MySQL Community Server)
PHP 7.4.3
In the source code of Mediawiki, I have code as below:
<ul><li><a rel="nofollow" class="external text" href="file://///networkwithaccess/myfolder/myfile.doc">This is my file</a></li>
When I click on it, it does nothing, and certainly does not open/download the file (Microsoft-Word document).
However, from the same machine (where I am trying to open it from mediawiki link), I can successfully open (download) the file by typing the following in the browser. When I type the following in the browser, the myfile.doc downloads
file://networkwithaccess/myfolder/myfile.doc
However, from the MediaWiki link, it does not download. The link in mediawiki shows it as a link (with a rectangle and arrow symbol at the end of the link). But clicking on it in Mediawiki does nothing.
I also have the correct setting in LocalSettings.php as:
# File Link Protocols configuration $wgUrlProtocols = array( 'http://', 'https://', 'ftp://', 'irc://', 'gopher://', 'telnet://', // Well if we're going to support the above.. -var 'nntp://', // @bug 3808 RFC 1738 'worldwind://', 'mailto:', 'file://', 'news:' );
array_push($wgUrlProtocols, "file://");
$wgPFEnableStringFunctions = true;
In httpd.conf, I have:
<Directory />
AllowOverride all
Require all granted
</Directory>
My .htaccess is:
<IfModule rewrite_module>
RewriteEngine On
RewriteOptions inherit
# Fix for bug T64289
Options +FollowSymLinks
</IfModule>
I did NOT do anything else related to Template:Unc, nor I downloaded anything extra. All I have done is the above. Nor, I understand where to look for Template:Unc.
Now, with the above setting, the file successfully downoads in Internet Explorer11, but it does NOT in Microsoft-Edge, Chrome, Mozilla browsers.
In Chrome, when I click on that link, it gives the error in the developer console as:
Not allowed to load local resource:
I have also closed all the Chrome instances and opened a new instannce of Chrome browser using:
chrome.exe –allow-file-access-from-files -disable-web-security
But that did not help either.
Can you please advise what I need to do to make this link download the file from MediaWiki? Or, does MediaWiki download it silently in a directory? I do not have any directory as such configured in the LocalSettings.php. But if it indeed downloads it silently in my local machine, how to verify from any settings?
The MediaWiki runs in a different Windows server and I open it from a browser in my personal Windows machine. From my personal Windows machine, I can open the file from browser using the file:// syntax. On the contrary, from the personal machine, when I click on the link in MediaWiki, no download happens.
Added clarification (see edit history)
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.