What is the best way to remove the Parent Directory link or limit access to a specific folder in a locally generated HTML code?

Here is a snippet of HTML code.

<link rel="stylesheet" href="/static/style.css" type="text/css">
            <p style="margin-top: 1em"> <font size="6" face="sans-serif"> <marquee> ABC </marquee> </font> </p>

            <a href="C:\Users\abcde\OneDrive\Desktop\Desktop_Ruff\management\scripts"  >Go to downloads page</a>

When viewing this code in my browser, I am only able to access files within the scripts directory. However, if I click on the parent directory button within the HTML file, it allows me to access files from the parent directory as well.

Answer №1

It is impossible for an HTML document to restrict access to specific files on a user's computer.

The only way this could be achieved is by configuring file system permissions at the local admin level, and even then it may not be possible to grant access to a subfolder without also allowing access to its parent folder.

If you were using an HTTP server, the situation would be different; however, since the link provided begins with C:\Users, it is evident that an HTTP server is not being utilized.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Dividing a button within a flex container

I'm currently building a contact form and I applied display:flex to its div. All the fields are showing up properly and dynamically resizing, except for the submit button which always gets cut in half. Shouldn't it behave like the rest of t ...

Using JavaScript, insert unique texts into div elements with the same id

I am working with 5 divs that have the id of "correctAnswer". In my array, I have 5 elements. How can I insert these 5 elements into the 5 divs? Here is the approach I am taking. var answers =["David Bowie","AM","Australia","Boneface","Sound City"]; for ...

Using jQuery to pass UI positions as percentages instead of screen positions

Currently, I have implemented the following code to send $_GET values to a PHP page: $.get('/includes/sticky_notes/update_position.php',{ x : ui.position.left, y : ui.position.top, z : zIndex, id : parseInt(ui. ...

I'm having trouble getting my jQuery to connect with my HTML, no matter what I do

UPDATE: Thank you everyone, I finally figured out that it was the API causing the issue. Even though I downloaded the files to avoid server requests, I will switch to using https instead. I have a couple of questions. Why isn't my code functionin ...

I encountered an issue with nesting a ul within another ul and despite researching, I have not found a solution that addresses my specific problem

An issue has been detected: Element ul is not allowed as a child of element ul in this context. (Further errors from this subtree have been suppressed.) Check out the HTML code below: <tr> <td> Incorporated Business Accounts - addition ...

The start screen fails to display when clicking the restart button

I am struggling to get the restart button to display the start screen again. Even though I have called the restart function within the clearColors function, which should show the start screen, it hasn't been effective so far. Initially, in the fadeOut ...

Retrieve an image located outside of a container

I have multiple SVGs inside separate div elements. <div id="divA"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="10" y="10" height="130" width="500" style="fill: #000000"/> ...

Implementing an interactive tab feature using jQuery UI

Recently, I was working on a project involving HTML and jQuery. Now, my goal is to create a dynamic tab with specific data when a button is clicked. This is my code for the JQuery-UI tab: $(document).ready(function() { var $tabs = $("#container-1 ...

What are the drawbacks of using JavaScript to load a series of images?

Currently, I am facing an issue with the loading speed of a sequence of images on my website. The javascript code I have implemented to cycle through 50 images works perfectly fine locally but becomes slow and buggy when the site is live. Despite the image ...

Having trouble getting the background image to display within the div element

I'm having trouble getting my background image to display in the specific div I want it in. It works fine when I place it in other elements, like the body element, but for some reason, it's not showing up where I need it to. Any chance you could ...

Tips for eliminating annoying white space on petite gadgets with css programming?

Having an issue with my static html page where I am seeing white space on the right side when checking responsiveness. I have tried multiple solutions found here on stack overflow, including adding the following code: I attempted to add this inline: html ...

WebStorm by JetBrains came across an unexpected token while running Jest

Encountering difficulties running a simple project in WebStorm IDE. Upon attempting to run, the following error is displayed: Test suite failed to run Jest encountered an unexpected token This typically suggests an issue with file import that Jes ...

Designing a structured layout with div elements resembling tables within a Bootstrap 4 card

I'm struggling with formatting this card. My goal is to create two columns, one with the class col-xs-3 and the other with the class col-xs-9. The titles in the col-xs-3 column should align with the corresponding titles in the col-xs-9 column. Unfort ...

Modifying the cursor appearance during object dragging is a simple task that can enhance

html .container, .container * { cursor: url('img/arrowPointer.png'), auto; } javascript $('html').on('dragstart', function () { $('html').addClass('container'); }); $('html').on('d ...

After clicking on a link, there will be a brief pause before the page transition occurs, once

I've been looking for solutions to similar problems, but none of them have worked for me. Here's my issue: I have a few links in the header of my website (such as about, portfolio, etc.) and I have a JavaScript animation that triggers when an &l ...

Angular: merging object values into a single string by looping over them

i am dealing with the following data : "commercialRanges": [ { "rangeId": "700", "rangeName": "POSTPAID" }, { "rangeId": "500", "rangeName": "PREPAID" }, ] In my view, I am aiming to display the ...

Exploring reviews with an innovative combination of Node.js and MongoDB

Recently diving into the world of Nodejs and mongoDB, I am excited to create two distinctive pages: one for users to update their account details such as profile picture, email, and name - all of which would be saved into the database; and another for re ...

Adding Font Awesome icons to Bootstrap forms in WordPress (using CF7): A step-by-step guide

I am currently working on creating a custom WordPress theme using Bootstrap4. Everything is going smoothly, except for my contact form which appears like this: https://i.sstatic.net/iEysI.png Below is the code I have implemented: <for ...

"Error: Unable to locate CSS background image file: net::ERR_FILE_NOT_FOUND

I currently have a background image set for the bottom of the header as shown below: header { background:url(../img/header_bg.png) #ea6225 no-repeat; background-size: 100% auto; background-position:left bottom; } The images are located in a folder ...

Application of stroke-linecap in SVG limited to single end only

Can a linecap be added to only one end of a stroke, rather than both ends like in the default sample below? <?xml version="1.0"?> <svg width="120" height="120" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg"> < ...