Vu Tien Lam
Vu Tien Lam

Reputation: 71

how to allow user download file over web page on window server 2003

I have a webpage deployment on iis6, window server 2003, and i want to allow user can download some file from webpage I store this file on the backup folder. I added NETWORK SERVICE user to the folder but I still can not download this file

Simple, i have a file and i want user can download this by link: http://www.aitapgdtrh.edu/Backup/SaoLuu13112012_1435.bak

it's shown the error: The page cannot be found

HTTP Error 404 - File or directory not found. Internet Information Services (IIS)

Please help me config to download it, Thanks!

Upvotes: 2

Views: 3128

Answers (3)

Vu Tien Lam
Vu Tien Lam

Reputation: 71

I found the answer for my question: It's:

Open IIS, right click, choose Properties. At group MIME type, click News,

Add:

Extension: .bak

MIME type: data/sql

then it's ok :)

Upvotes: 3

just.another.programmer
just.another.programmer

Reputation: 8785

HTTP 404 means that IIS cannot find the file specified by /Backup/SaoLuu13112012_1435.bak. I assume this is because it's located at C:\Backup and not in inetpub.

Request URLs are relative to the website root path, so /Backup/SaoLuu13112012_1435.bak will refer to C:\inetpub\wwwroot\aitapgdtrh.edu\Backup\SaoLuu13112012_1435.bak not C:\Backup\SaoLuu13112012_1435.bak.

You can reference locations outside of your website root path by using a virtual directory1:

  1. Open IIS
  2. Browse to your website
  3. Right click the root node
  4. Click "New Virtual Directory"
  5. Specify "Backup" as the Alias
  6. Specify "C:\Backup" as Path
  7. Assign read permissions only
  8. Save the directory

1You're allowing read access to the entire Backup directory to anonymous clients by doing this. For security, you may want to require authentication (either NTLM or Forms).

Upvotes: 1

paulsm4
paulsm4

Reputation: 121669

The easiest way is just write an ASP.Net script that uses System.Web.UI.WebControls FileUpload:

Upvotes: -1

Related Questions