Does anyone know how to link to a file on a local hard drive from the menu. It can be done on nodes, and on custom blocks, but for some reason it seems to be impossible to do this from the menu. My users will not be allowed to create custom blocks, so I need a way for them to add their content (sometimes - links to local files) to the menu.

Please help. This is seriously limiting the functionality of our site.

Brian

Comments

wings’s picture

I'm using Drupal 4.6.6, with PHP 4.4.2, on Apache 2.2 under Red Hat Linux 9

Steven’s picture

Status: Active » Closed (works as designed)

Use absolute URLs.

wings’s picture

Is there a setting somewhere for absolute URLs that I can change? I've obviously been typing the absolute URL in but that's getting me nowhere.

RobRoy’s picture

IIRC, Drupal 4.6 doesn't allow absolute URLs in menu items, that came in 4.7. I would recommend upgrading.

wings’s picture

Version: 4.6.6 » 4.7.4

I have upgraded to Drupal 4.7.4. I still can't get the link to work - it still appends file://etc on to the end of www.mysite.com/drupal/?u=. Is there somewhere I can set it to use absolute urls?

RobRoy’s picture

Oh, you're linking to files on the user local computer? I am not sure why you would ever want to do that.

wings’s picture

We are using Drupal for our intranet site, and we want staff to be able to get at certain local files easily.

RobRoy’s picture

Category: bug » support
Status: Closed (works as designed) » Fixed

Okay, the easiest way to do this in 4.7 is to install devel module then execute this PHP code. This is just off the top of my head, but should allow 'file://' URLs now.

variable_set('filter_allowed_protocols', array('http', 'https', 'file', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal');

wings’s picture

I'm getting the following error when I try and run that PHP

Parse error: syntax error, unexpected ';' in /var/www/html/drupal47/modules/devel/devel.module(454) : eval()'d code on line 1

Sorry - my PHP is so poor I'm not able to figure out what's wrong with it. Removing the ; just gives an unexpected $end error:

Parse error: syntax error, unexpected $end in /var/www/html/drupal47/modules/devel/devel.module(454) : eval()'d code on line 2

wings’s picture

Perfect! There was just a bracket missing from the PHP, once I spotted that it worked perfectly.

Many thanks

Brian

RobRoy’s picture

I had left out an extra parenthesis on the end. Try this:

variable_set('filter_allowed_protocols', array('http', 'https', 'file', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal'));

Anonymous’s picture

Status: Fixed » Closed (fixed)