Reputation: 71
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
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
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:
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
Reputation: 121669
The easiest way is just write an ASP.Net script that uses System.Web.UI.WebControls FileUpload:
Upvotes: -1