Download question

  • Thread starter Thread starter The Clansman
  • Start date Start date
T

The Clansman

Hi,
I am developing a site for a company and this site will have files available
for the customers to download, but only the customers loged in will be able
to download these files and the files availables for each customer will
depend on the type of the customer.

so how can I prevent a user from downloading a file by typing the full url
(example, http://www.company.com/file.exe)

if the user type the url of the file, I want the user to be redirected to
the login page.

**some files are larger than 50MB

Thanks
 
Hi,
I am developing a site for a company and this site will have files
available
for the customers to download, but only the customers loged in will be
able
to download these files and the files availables for each customer will
depend on the type of the customer.

so how can I prevent a user from downloading a file by typing the full
url
(example, http://www.company.com/file.exe)

if the user type the url of the file, I want the user to be redirected to
the login page.

**some files are larger than 50MB

Thanks

The easiest way is to map all of the files' extensions to the aspnet dll
in IIS. So go into your web app in IIS and copy the dll setting for .aspx
to each of the other ones (.exe, pdf, etc.). This will cause requests to
be passed thru the aspnet process (which will then just serve up the
file), enabling you to protect them via Forms Authentication.

Note you'll want to test this a little, to make sure of no problems.
Performance impact should be minimal as well.
 
thanks,
but I'm using a hosting service, the web server is not a server that I have
access....

is it possible to configure this at the hosting server?

thanks
 
My suggestion would be to binary read and render to client such that the
users will never get to see the file url.

Sekhar.


The Clansman said:
thanks,
but I'm using a hosting service, the web server is not a server that I have
access....

is it possible to configure this at the hosting server?

thanks
 
the problem is that is I use WriteFile, the file will be loaded into the
memory, and if I send chunks of data, the user won't be able to navigate
other pages.... the user will need to wait the download to complete.....

thanks anyway

Chandra Sekhar said:
My suggestion would be to binary read and render to client such that the
users will never get to see the file url.

Sekhar.
 
Not really, if you have a isolated virtual directory which does only the
file transfer, you may not interfere with the user's current process.

Sekhar.
 
but as I said, the site will be hosted in a hosting company..... I don't
have access to IIS to create a new virtual dir etc etc...

Bruno
Chandra Sekhar said:
Not really, if you have a isolated virtual directory which does only the
file transfer, you may not interfere with the user's current process.

Sekhar.

The Clansman said:
the problem is that is I use WriteFile, the file will be loaded into the
memory, and if I send chunks of data, the user won't be able to navigate
other pages.... the user will need to wait the download to complete.....

thanks anyway

My suggestion would be to binary read and render to client such that the
users will never get to see the file url.

Sekhar.


thanks,
but I'm using a hosting service, the web server is not a server that I
have
access....

is it possible to configure this at the hosting server?

thanks
 
If you are using DomainName for the page the user is currently on, open up
the binarywrite page from the IP address url. This might solve.

Sekhar.


The Clansman said:
but as I said, the site will be hosted in a hosting company..... I don't
have access to IIS to create a new virtual dir etc etc...

Bruno
Not really, if you have a isolated virtual directory which does only the
file transfer, you may not interfere with the user's current process.

Sekhar.
that
 
the problem is that is I use WriteFile, the file will be loaded into the
memory, and if I send chunks of data, the user won't be able to navigate
other pages.... the user will need to wait the download to complete.....

thanks anyway

you could popup a new window for this, then they can still go back to the
other window to browse around. not a clean UI experience, but....

About my solution: normally you don't get access to the dll mappings with
shared hosting; didn't know you were hosting when i posted that solution.
If it was dedicated hosting, you pry can do it if you ask the host.
 
I sent an email to the host company asking if they can make that change in
the mapping....

I just had an idea, create a FOLDER named Download.aspx and put the files
inside this folder.... when I type ...server/Download.aspx/file.exe I get
error 404....

I'm trying to get it working.....

ideas??

Bruno
 
no way...

The Clansman said:
I sent an email to the host company asking if they can make that change in
the mapping....

I just had an idea, create a FOLDER named Download.aspx and put the files
inside this folder.... when I type ...server/Download.aspx/file.exe I get
error 404....

I'm trying to get it working.....

ideas??

Bruno
 
Back
Top