I ́m working in a local project (offline) and need show a txt file outside of directory of html. How implement the relative path?
main-app
|
|-core-app
|
|-logs
| |-log-file.txt
|
|-plugin
|-plugin-core
|-www
|-index.html
The file is on logs folder, I need show it in index.html. I try to use src="../../../logs/log-file.txt" but don't work. An example of the code in html:
<object type="text/plain" data="../../../logs/log-file.txt"></object>
sohel khalifa
5,5863 gold badges36 silver badges46 bronze badges
2 Answers 2
relative to index.html I think that it should be : data="../../logs/log-file.txt". One less directory shift.
answered Oct 11, 2012 at 12:44
Nicole Stutz
5164 silver badges15 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Just change the .txt file to a .html file, and add styling... It works just fine, just add a linkto it in index.html.
Comments
lang-html
/logs/log-file.txtshould work.wwwdirectory, you cannot access the logs directory since it is outside the web root.. you will need to do it with server side code, get the code into a variable, and print it on the html or inside thedata.