Solution 1 :

There is no way for an HTML document to control what files a person can access on the disk of the computer they are using.

The only way to do that would be for a local admin user to set the permissions on the file system (and I’m pretty sure you can’t allow access to a subfolder without allowing access to the parent folder too).

This wouldn’t be the case if you were using an HTTP server, but since the link starts with C:Users, you clearly aren’t.

Problem :

Below is a line 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:UsersabcdeOneDriveDesktopDesktop_Ruffmanagementscripts"  >Go to downloads page</a>

When I am opening it in my browser, I have to access files that are in scripts directory only but by clicking the parent directory button in the opened HTML file it’ll able to access files that are in parent directory too.

Comments

Comment posted by kite.com/python/docs/flask.send_from_directory

kite.com/python/docs/flask.send_from_directory

Comment posted by Anshuman Kumar

I sent you one for Flask, which is a framework meant in Python.

Comment posted by Alon Eitan

Did this HTML come from the 90s?

Comment posted by shai

@AnshumanKumar This a sample application of login. Once a user is logged in, after clicking that download load button he fas to redirect to only a specified folder in the local system. He’s allowed to see files in that specified folder only but on the top parent directory option allowing him to access other than what we mentioned in the folder. I tried giving relative also but the same is happening. I am running it locally only.

By