How do I grab or href a file from root folder using this method:
../../../pages/development/topic/programing.php
I am having some problems using this method, trying to link from to domain folder(root folder), so used this method.
Read more
But this doesn't work, so how do I link a file form root folder
You can directly specify the complete address in href of the destination as shown below.
Read more
or use this instead
Read more
This will also work fine.
You can only serve files that are in the Apache directory. You will need to move the file into the Apache directory or use a php script in combination with include_once:
<?php
include_once("../../../pages/development/topic/programing.php");
?>
Note that this is an insecure approach, especially if you insert variables into the string.
Related
I'd like to change the page that shows what files I've uploaded. I never found the editable file. Can it be changed at all?? I have read a bunch article about this problem but I haven't found the solution.
I am talking about this page: Index of /--
Here is my shared folder: Location
Change the index file (probably: index.html or index.php) or add one yourself, if it does not exist yet. You can use .htaccess for example, if the directory or files inside should be access protected. You can also redirect the user when he is accessing the directory or a file inside.
The images that you have provided show the fallback display of a directory for apache.
I have created a html file of my results using .to_html() function.By default the html file saves to the root location of your project folder.But what if i want to save it to the specific location?How to give a path to the created folder .Im using flask to connect python to html.
You can access the root path of the flask through app.root_path.
So let's say your folder name is myHtmlFiles. So we can save the files like below:
file.save(os.path.join(app.root_path, "myHtmlFiles", "hey.html"))
You can also take a look at app.config, you can put your folder path here and use it anywhere in the aplplication.
I'm using nginx to build a web server. By default, there is a folder named html, which contains an index.html and a 50.html. If we visit localhost, the index.html in the folder html will be shown.
Now I need to create my own folder containing all of my .html files. But when I configure nginx and try to visit them, I always get an 403 error.
For now I'm considering it's the problem of attributes of .html files.
I've found that the attributes of html folder contain an #, whereas my folder doesn't. I want to know what does it mean and how to add such an attribute for my own folder.
The # signifies that the file has extended permissions attributes beyond the standard U/G/O. It could be related to metadata or quarantine functionality. You can view the attributes by using the xattr command:
xattr file.jpg
You can remove the extended attributes like so:
xattr -d file.jpg
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xattr.1.html
I have seen a few examples with link to folder but i realy don't understant what it is or how to manipulate it or get it to set the specific html page within the folder.
My website is a basic one with only CSS and HTML
it is formatted as
[file]home.html // C:/Users/user/Desktop/mywebsite/home.html
[folder]Order // C:/Users/user/Desktop/mywebsite/order/
↳[file]ordersheet.html // C:/Users/user/Desktop/mywebsite/order/ordersheet.html
I want to try set the folder path C:/Users/user/Desktop/mywebsite/order/ as the file ordersheet.html C:/Users/user/Desktop/mywebsite/order/ordersheet.html how can this be done?
To set /order to ordersheet.html change the name of ordersheet.html to index.html
The index.html is the default file that the server will serve to the visitor when he visits that specific directory.
link text
link text = what you want it to say to the user
/Users/user/Desktop/mywebsite/order/ = directory path
Keep in mind that this will only work locally. If you have it up on a server, visitors don't have access to your full C:/ drive so you have to use relative links, i.e. just /order/
If I remebember correctly, you use something like this:
<a href="file:///C:/Users/user/Desktop/mywebsite/order/ordersheet.html>link to file on harddisk</a>
If you would want to have that anchor to a folder, you would just use this:
<a href="file:///C:/Users/user/Desktop/mywebsite/order/>link to a folder on harddisk</a>
Your browser is operating directly on your system's local filesystem, so you can't.
What you have been looking at is a function of a web server (I'll use Apache HTTPD for examples here).
A typical configuration of a web server would map the local part of the URI onto a directory on the local file system and just serve up the files there if they matched the local part of the URI.
If the local part resolves to a directory (rather than a file) then it would look for a file in that directory with a name that matched a list (typically including index.html) and serve up that file.
If none of the files on the list existed, then it would generate an HTML document containing links to all the files in the directory.
Since there is no web server involved when the browser is reading the local file system directly, there is no way to map the directory onto an index file, so you would need to explicitly include the filename in the URI (or switch to using a web server).
I would like to access a local file in the immediate directory
From my understanding, you'd usually have to do something like
file://path/to/file/document.html
which requires the full path, but I would like to do something like
file://./document.html
instead, where ./ represents the current directory reference, so that I do not have to know the directory path nor make any assumptions about it.
is there any trickery like that possible with html file paths?
Use:
document.html
With no protocol specified, and no / for directories, the browser should request the asset from the same directory/folder that the current page is at.
If it's running locally (from that directory), just use ./ without the file://.
try this http://www.nt22.com/html_tutorials/022_html_path.html
using page.html and ./page.html works the same.
../ goes to a lower directory
i.e.
root/www/page.html
if you are in root/stuff/hi.html you can go to the 'www' directory by doing
../www/page.html