Windows file path format for link in a Configure Block > Block Body

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
runnergirl's picture

System Information:
-Windows Server 2012 Standard
-Drupal 7.4.1
-MySQL

I'm sharing information that worked for me when creating a link in the block body, to a file folder location. Keep in mind that correct permissions would also be necessary to have the desired result of the user clicking the link and having success displaying the files within the folder. But another part of that success would be typing out the file path using the correct structure.
Example:
file:///S:/IMD/APS/Ique_Project/06-Training/R2%20User%20Guides/Final_BPD...

In this example "S" is the mapped drive to the file server "ipers10" (see attachment).
The "%20" denotes a space in the folder name and is automatically placed there for you when a space is entered.

I've also attached a screen shot for the block body link.

AttachmentSize
insert_edit_link.JPG88.88 KB
S_mapped_drive.JPG17.76 KB

Comments

windows share links in Drupal

Todd_Rector's picture

Hi,
You will also notice different browsers have different restrictions on whether or not they will allow you to open a UNC link. Chrome and Firefox are both very picky.

As a state of Iowa agency, you might find additional browser restrictions based on group policies.

My two cents -

TR

Opinions and sarcasm are solely mine and do not reflect the views of my employer.

Use the Share Name in the Link

jkraai's picture

good screen shots

from what i can see,
file://ipers10/IMD/APS/Ique_Project/06-Tr...
should do the trick

see https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/

firefox users may still have problems

@Todd_Rector is correct that

iowatiger08's picture

@Todd_Rector is correct that Firefox/chrome will in fact not handle Windows file paths well. Also, for Drupal (or any web server) It is recommended to not use absolute mapped drive paths as they may be different for other users and it would be preferred to use the proper network UNC path/network share name. Avoid special characters and spaces in paths or names. It might be better to provide a relative path to the files (like in a file upload) where the web server can access resources.

Central Iowa Drupal Users Group

Group categories

Category

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week