Allow non-http URIs (e.g. file:\\) as link attachments #649

Closed
opened 2026-02-04 21:35:52 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @foremandomai on GitHub (Apr 23, 2018).

Desired Feature: Allow attachment of non-http URIs (e.g. file:\)

  • BookStack Version: BookStack v0.20.3
  • PHP Version: PHP 7.2.4
  • MySQL Version: Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1
Expected Behavior

file:\\ link attachments should be attachable to pages

Current Behavior

Trying to insert a non-http URI in the Attach Link menu while editing any given page fails and is unresponsive. Editing may still continue however the URI is not accepted or placed into the document as an attachment.

Here is an example link: file:\\server\share

Steps to Reproduce

See Above

Originally created by @foremandomai on GitHub (Apr 23, 2018). Desired Feature: Allow attachment of non-http URIs (e.g. file:\\) * BookStack Version: BookStack v0.20.3 * PHP Version: PHP 7.2.4 * MySQL Version: Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1 ##### Expected Behavior file:\\\ link attachments should be attachable to pages ##### Current Behavior Trying to insert a non-http URI in the Attach Link menu while editing any given page fails and is unresponsive. Editing may still continue however the URI is not accepted or placed into the document as an attachment. Here is an example link: file:\\\server\share ##### Steps to Reproduce See Above
OVERLORD added the 🛠️ Enhancement label 2026-02-04 21:35:52 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 12, 2018):

@foremandomai Thanks for this request, Should be a simple change to make so have marked for the next release.

@ssddanbrown commented on GitHub (May 12, 2018): @foremandomai Thanks for this request, Should be a simple change to make so have marked for the next release.
Author
Owner

@ssddanbrown commented on GitHub (May 20, 2018):

Okay, Looks like the validation did accept file paths but it would have had to of met a long regex.

For the next release I've opened this up to allow any strings to keep things flexible. I've also fixed the error handling that made this unresponsive.

One thing to note, which I only learnt while fixing this, chrome and firefox will not open local file links so you'll have right-click -> Copy link address for such links. Bit of a nuisance.

@ssddanbrown commented on GitHub (May 20, 2018): Okay, Looks like the validation did accept file paths but it would have had to of met a [long regex](https://github.com/laravel/framework/blob/5.5/src/Illuminate/Validation/Concerns/ValidatesAttributes.php#L1359). For the next release I've opened this up to allow any strings to keep things flexible. I've also fixed the error handling that made this unresponsive. One thing to note, which I only learnt while fixing this, chrome and firefox will not open local file links so you'll have right-click -> Copy link address for such links. Bit of a nuisance.
Author
Owner

@joeleclems commented on GitHub (Jul 19, 2018):

Non URI linked are accepted in the link component, but are not usable.

Is there any format to use to let navigator interpret link as a file?

BookStack Version: BookStack v0.22

@joeleclems commented on GitHub (Jul 19, 2018): Non URI linked are accepted in the link component, but are not usable. Is there any format to use to let navigator interpret link as a file? BookStack Version: BookStack v0.22
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#649