How to view included SSI file - html

Is there any possibility to view the virtual included SSI file, for example with eclipse?
In this example:
http://www.ssi-developer.net/ssi/ssi_page_template.shtml
how to view top-links.shtml ?

I would expect you have to have access to the directory that the file is in and open it directly. Opening it via the web URL will likely not succeed because it's usually filtered by the web server.

Related

Import files into a directory on a HTML document

I am wondering if I can have a webpage where I can tell it to grab my file and put it in a directory, such as: "http://example.ex/folder". Meaning the file I provided is put into the "folder" folder.
Overall process:
Button says: "Import file"
I select a file, and my file is "text.txt"
It takes my file "text.txt" and adds it to the local system/directory of the website.
You can do this using JQuery File Upload and then adding a backend service that captures the file and saves it.
For example, here is a repository that has a basic Python (Flask) server integrated with JQuery File Upload that will take an uploaded file and place it on the server:
https://github.com/ngoduykhanh/flask-file-uploader
I'd put the rest of the code here, but it is a lot - and requires HTML, JavaScript and a back-end language (like Python).
Here is the documentation on JQuery File Upload: https://github.com/blueimp/jQuery-File-Upload
As a word of caution, DO NOT TRUST ANYTHING UPLOADED TO YOUR SERVER. Meaning, do not put it out on the open internet without some sort of authentication or checks in place to make sure only files you intend are uploaded. Otherwise, people will find it and upload scripts turning your device into a Bitcoin miner, spam relay, or bot host.
Instead of doing it this way, why not use SFTP to upload it to your server to host? At least that way you can lock down access.

How would I access a back-end webpage?

These files I have uploaded to my host provider "hostinger". Now usually the index.html page would be the root page of the webpage itself by accessing it like SOMEPAGE.com. Also I have an admin.html file which is some sort of a settings page where want to be able to make changes into and access index.html page.
How would I be able to access that page the same way I would access the index.html or SOMEPAGE.com in the web in the link bar of the browser?
The URL can accept a path to a directory structure on your server starting at the web root, which in your case is the directory where index.html is stored. By default if the file name is omitted the web server will look for a file called index.html and try to display that in the browser. If you specify a different file name it will look for that file instead.
In your case to access admin.html you only need to specify the file name after the domain.
example.com/admin.html
If it was in another folder you can specify the folder path separate by /
example.com/somefolder/admin.html

java server pages and html

From what I understand a jsp is responsible for dynamically generating html pages, which are later sent to the client browser for viewing. But then why do browsers show a .jsp extension while viewing some pages? Is it possible to view a .jsp file in a browser?
But then why do browsers show a .jsp extension while viewing some pages?
Because, traditionally, JSP files have .jsp file extensions, and URLs map directly onto files on a filesystem (these days the front controller pattern means you see less of that).
Is it possible to view a .jsp file in a browser?
Not an arbitrary one. Servers execute server side programs and return the output to the client, not the program itself.
You need to have a server to view jsp files. I think you can find your answer here

how to embed pdf file in html with security?

I am using below code to display pdf file in HTML
<object data="data/file.pdf" type="application/pdf" width="300" height="200">
test.pdf
</object>
But In above code we have to specify path name and folder name so it is not so secure. Crawler can find this path, so using some algorithms(robot) it is very easy to download other file those are stored in that folder.
How to secure this, is there any option to prevent this from robots?.
You may do the following:
Password protect the page (with the server-side code).
Generate unique links like (/getpdf/some_random_string_or_md5_hash_of_random_string.pdf) for every PDF file (using server-side code) that will a) check for the current time and the validity of the random name generated (if it has expired or not) then b) will redirect to the source files (not really hiding the source because of the redirection) to be displayed or stream the PDF file content (this is more secure though could seriously add the load to the server).
Finally add robots.txt to the folder and hope that crawlers will follow restrictions it sets.
If the other files in the directory are not to be downloaded, ever, they shouldn't be in a directory that is available to the http server. You can use directory permissions in your http server (eg., config directives and .htaccess in Apache) to control access to directories. Only configure access for directories you need to expose to the web, and only store files in them that you want the web to access.
If you want to avoid including a path in the HTML, you will need to write some dynamic code (eg, php, asp, or any number of server-side options). Your code on the server would need to handle the request for the file and return the file's content manually.

XML: rendered as an HTML file in URL

I've been given the task of rendering an xml file via xsl as html. This means it appears as /.../index.xml in the URL.
However, the task requests that the xml file renders in the URL at /.../index.html.
Currently it renders as index.xml not .html - how do I achieve this?
Any ideas/resources would be great, thanks.
One simple way to satisfy the requirement (there are others, no doubt) is to configure your server to redirect index.html to index.xml. How you do that depends on which Web server you are using; consult the documentation for your server. If you're using Apache, you will want to read up on .htaccess files and redirection.