password protected file associated with a hyperlink - html

I am trying to create a homepage, which includes hyperlink.
For example, after clicking sth called file1.txt, I should be directed to text file. However, before the file is to be displayed, a box should be popped up asking username and password. Can you tell me how to do it? Thanks.

With plain HTML? You can't.
The simplest way is to use HTTP Basic Auth. The specifics of which depends on the web server software you use. e.g. for Apache: http://httpd.apache.org/docs/2.2/howto/auth.html

Related

Add styling to HTTP Basic Authentication prompt

Hi i have a website that i use a .htpasswd thing on to protect my directory but is there a way to make this look better?
https://prnt.sc/r3Dk5iUMOZKw
No, this is a native browser component that you cannot modify. You can build your own password protected page to access your directory but it is a whole another story.

RainLoop - Pass values in a URL link and automatically Sign In

I am trying to pass a value using a link.
For example, if I want to add an email and password for a user to Sign In straight away in the RainLoop webmail.
I am trying using
http://demo.rainloop.net/?RainLoopEmail="new#email.com"&RainLoopPassword="12345"
or
http://demo.rainloop.net/?RainLoopEmail="new#email.com"&RainLoopPassword="12345"#ID
Is this possible to do?
It is possible but you will have to rewrite the rainloop PHP files by yourself. Also parsing passwords via the GET method is a very bad idea. Get commands will stay in your history so everyone who types in
demo.rainloop.net will see the ?RainLoopPassword="12345" also. It's not recommended, but possible. Another safer solution will be using the POST method. I suspect you will use this for you bookmarks or something? You can make an AJAX page which sends a POST request with the username and password to demo.rainloop.net. This way nobody will see your passwords and the effect is the same.
EDIT: For using an AJAX page you have to own a webserver, or register on a free hosting like http://freehostingnoads.net

How to allow access to a file after passing from other file in apache?

What I'm trying is that if someone logs into my website, I want the file configPage.html not to be accessible directly (from www.mydomain.com/configPage.html), but I want it to be accessible if had passed from login.html before.
I have to say that is my first web page so don't blame me if I'm trying something that makes no sense ;).
Thank you.
If you dont need some one to access your configPage.html then create a login page and then redirect to configPage.html. And if some one manually try to enter the file name in the brower , you can check the session variable set or not . If not you can make page to redirect to your login page.

How do I make a button link that will download a file to the users computer once clicked?

I have several buttons on a Download page that I want to link to different movies stored on the server so that once the user clicks the download button the movie will download to their computer. How do I do this? I thought it was simply a case of putting the directory path to the relevant file into the link for the button?
Here's the page: http://www.infomaticfilms.com/jack/infomatics/download.htm
Any help would be appreciated.
Jack
I assume that you want the user to be presented with a Save As dialog instead of just opening the file in the browser?
There are really two components that make this happen:
The user's browser is configured to download that type instead of open it directly. You have no control over this, it's up to the user's own configuration.
Your server suggests to the browser that it should download that type instead of open it directly. This is done via a header value in your server's response.
The header you're looking for is called Content Disposition. How you use it is up to your server-side capabilities. But basically you want to set it to something like:
Content-Disposition: attachment; filename="filename.mpg"
This response header tells the browser that what you're sending it is a file and should be locally saved as one. (Remember that HTTP by itself has no notion of "files", only requests and responses with headers and data.)

How do I make a file download require a username and password

In a basic HTML web page, how do you make the user have to enter a username and password before they are allowed to download a file?
What is the best way of achieving this on a website, preferably in plain HTML?
This can't be achieved in HTML.
With client side technologies, the best you are likely to be able to achieve is a JavaScript prompt that you use the data from to direct people to a secret URI.
This is something that really should be handled by the web server.
You won't be able to do this with plain HTML. Easiest way is probably to place the protected file in a directory protected by an .htaccess and .htpasswd file.
I agree with David...this can't really be done. Putting up a JavaScript prompt only protects you so far as well...that isn't really secure.
If you are on an Apache server, you could setup a .htaccess file and setup some user authorization options that point at a page which has the link to your download file. A simple implementation would give you 1 user/password combo that you could distribute to your users. The Apache documentation for this may be found here. Unfortunately I'm not really familiar with how IIS handles this sort of thing.
If you don't want to distribute a generic username/password combo to your users, you're pretty much going to be stuck creating a (or making use of an exsitng) user-management system. There are quite a few modules strewn throughout the web, and a simple Google search should bring you to quite a number of tutorials or existing implementations, depending on what you require.
first download phpmyadmin.open the file.click on create login.name it as login.php.then create a new want again name file.php.after you click yes it popout a logon information.enter the usrname you want and password you want
hope this help!