I'm trying to download some files from a virtual directory using WebClient class and DownloadFile method, all files download good except files with .sql, .flag, .tmp, . InstallState extensions. I get the "HTTP Error 404 - File or directory not found" error. This extensions are not in the Application Configuration Mappings, so what do I have to configure in order to download this files? Because I can't figure it out. Thx. (I'm using windows server 2003 )
The reason for this is that the web server probably doesn't have MIME types configured for these file extensions.
Because these are being served as static files over HTTP you'll need to add them.
If these files are residing on a public facing server administered by you, do you think it's wise to be serving these? Why not obtain via FTP?
Related
I have a problem - I cannot find my file when I open it using http://localhost:49652/.well-known/acme-challenge/FfI7Xeq7_QH5R5pCd3LhAkU4k3nOqBz9mNbvJ9EwMoQ although it exists and the path is correct.
I use ASP.NET C#, OS: Windows Server 2012 And IIS 8.0.
And error:
Help me... Please!
I want to forward you to an other question: What file extensions are blocked by default in IIS
The issue is that IIS has a configuration, how to handle requested files.
Depending on the extension, there have to be done different actions: While resources like .txt or .jpg files are just sent into the network as they are stored on the disk, other files like .aspx or .asmx have to be parsed, executed in dotnet and then the output have to be sent etc.
Other extensions like .dll or .exe are blocked by default, I think.
The problem is, that your files do not have any extension, so for this directory you have to configure that IIS should pass through all of the files.
Found another usefull link to microsoft: https://learn.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/fileextensions/
I've published my ClickOnce application to my website via FTP.
I've got 404 error (not found) when run "app.application". In log file there is a line that says cannot find "app.exe.config" file.
I noticed that I can access to this file via FTP and online file manager of website, but when I try to use HTTP, this error is shown.
I've created new files with different names on website (all of them have .config or .cfg extension), but result is the same: I cannot access them via HTTP (through address bar of browser).
I am using a windows web hosting server and it has a "web.config" file in the root folder of website.
Should I do any change in server settings or I must rename my .config file?
any help will be appreciated.
** Dumb questions alert **
I created my first Web API project. I would like to test it on my web host, but I can't figure out what files to upload. I tried to upload everything from the HelloWorld folder, but I get a 403 "Access is denied" error when I attempt to access the files.
Once I upload the folders/files, how do I access them? Do I have to navigate to the Root > Views > Home > ... ?
Folder Structure
HelloWorld
HelloWorld
_UpgradeReport_Files
1 css, 1 xslt, 4 pngs
HelloWorld
All of my folders and files
This is what I tried to upload
packages
A lot of ASP and JQuery folders
Thank you for your help.
I think you have two separate problems here: knowing what files to deploy and getting the permissions correct so that you can access them.
In general, the files you will need to deploy are all of your static files (images, CSS, Javascript, HTML), any .cshtml/.aspx/.ascx/.asax files, and Web.config. However, the easiest (and best) way to know what files to deploy is to use Visual Studio's publishing mechanism. Go to Build->Publish, and publish to a local directory. Open that directory, and you'll see all the files you need to deploy.
As far as the second problem, that's more complicated. The solution depends on the version of IIS, but the basic upshot is that you need to give the correct user access permissions to your file. Depending on your version of IIS and how it's confusing, it will either be IUSR, IIS_IUSRS, or NETWORK SERVICE. Try Googling for "file permissions IIS ".
I am using IIS 6.0. I have a file with no extension that is saved on my server, If I try to download this file it gives me a 404 page, how can I force the server to send the file as downloadable if the file exists
In order to get IIS to download the file it needs to have a file extension because IIS will only server file types that have been registered in the MIME Types collection. And in order for a file type to be registered under a MIME type it will need an extension.
You could build a simple ASP.NET HttpHandler that issues the file. That will work.
How do I download all files in a directory and all subdirectories on an HTTP server?
By using a command-line tool like wget rather than reinventing the wheel.
If directory browsing is enabled on the server then you can crawl the directory listings, i.e. Use HttpWebRequest to get the listing page, parse the response to find the file links, download each file (also with HttpWebRequest), navigate to each subfolder, rinse and repeat.
If directory browsing isn't enabled then you can't really download ALL files in ALL subdirectories because you can't know they exist.
However, you could still use HttpWebRequest to crawl the exposed web pages and download any linked files that are of interest.