Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Authenticate an .exe file

Posted on 2004-04-22
2
Medium Priority
?
219 Views
Last Modified: 2008-07-03
Hello,

Using PHP/MySQL I have a login form.  When a user successfuly logs in a session is established and they are redirected to a downloads page. This downloads page checks to ensure the session is established.  If it is, then the user can view the possible downloads.  One of the downloads is a .exe file.  Well, how can I ensure that the .exe link is authenticated as well?  For example, what is the user types in the address bar www.website.com/downloads/program.exe without logging in.  Well, in theory they have bypassed the authentication process and are able to get to the .exe.

Thanks in advance.
0
Comment
Question by:rudyflyer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
CosminB earned 500 total points
ID: 10896628
you can put your files outside your webserver's directory and download them width a download script
smth. like this
======= download list ==========
<a href="download.php?file=file1.exe">
<a href="download.php?file=file2.exe">
<a href="download.php?file=file3.exe">

======= download script ========
<?php
header('Content-type: ...'); //you can find the apropiate headers on http://www.php.net/header

if ($_GET['file'] == 'file1.exe')
   readfile('/path/to/your/downloads/file1.exe')

?>
0
 
LVL 10

Expert Comment

by:eeBlueShadow
ID: 10899111
Like CosminB says, what you essentially do is to sit the file somewhere on your server and collect it through PHP. This also has the advantage that you use the PHP file to update a counter for example, of how many times each file was downloaded

One extension to this is that you don't actually have to move the exe files. Create a file called .htaccess in the same folder as the .exes (or add the following lines to the file if it already exists)

<Files *.exe>
    Order deny,allow
    Deny from all
</Files>

This will make it impossible for people to get directly to the program files (assumes the server is Apache)
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question