How to Enable .MP4 File Video In IIS 7.5 - asp.net

I want to open file video but it not working
I'm tried enabled directory browsing.
Tried run aspnet_regiis.exe -i
Finally
How to open it? How to make it working? Thank you!

Hi i know is a old post but i hope that it can help you
1.- First create a folder into C:\inetpub\wwwroot example : resources
2.- Open IIS or windows + R and write inetmgr
3.- You'll see the folder you just created
4.- select the folder for this example "resources" and you'll see on the right all option to config
select and open "directory browsing" there's an option to change disabled/enable put it on enable and save changes
5.- Open browser and type the ip or url of your site and you'll see the files
6.- if you can't open the file check if the MIME Types and add the format of the resource.
This changes will be on Resources Folder or in the folder that you're working.

According to your description, I suggest you could add below config to set the MP4 mime map setting for your IIS web application.
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".m4a" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
More details, you could refer to below article:
https://blogs.iis.net/bills/how-to-add-mime-types-with-iis7-web-config

Related

My website hosted in the local iis can't load images, js and other files

I am totally new to IIS and this is my first attempt to host one of my websites on my own machine's IIS server.
I installed IIS using Add windows features on or off feature and used aspnet_regiis -i to install asp on it.
Then I copied my website's content to wwwroot directory and I have a partially working website, because some fonts, images, js files and a webm file can't be loaded into the page and when I go to these files by url I get this error message:
HTTP Error 404.3 - Not Found The page you are requesting cannot be
served because of the extension configuration. If the page is a
script, add a handler. If the file should be downloaded, add a MIME
map.
I should mention that I checked static content under common http features in Add windows features on or off but still I have the same problem
Thanks in advance for your help
UPDATE:
I used to have a host and domain and this website worked perfectly there, So it Not a website problem
UPDATE2
some pictures load ok and some don't.some fonts are ok and some don't.chrome's developer console states an 404 error message for missing files and scripts and when I go to them via url,I get the error message above(which indeed is a 404 error message)
UPDATE3
I added woff and webm formats to MIME types so now these types of files work.But still some javascript files won't work since they are using json I json format and json is not added yet to the list of MIME types
What can I do so that ALL TYPES OF FILES are allowed?
Modify your web.config like
<system.webServer>
<staticContent>
...
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
...
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>

IIS returns 404 not found for .mp4 files

I used hmtl video tag to play video . In my localhost video plays but when I published . It is not played.I have created project based on in ASP.NET.
I locally use like this method.
http://localhost:41563/files/Just.mp4
and When I published the url give me an error like this:
http://111.111.22.22:41563/files/Just.mp4
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
How can I solve this.
Check if you have IIS MIME Type for mp4 added for hosted site (or for the directory where you have your video files).
For the Win Server 2012 is is already there but for Win Server 2008 it is not included by default.
So, if you developed/tested on WinSer2012 and then deployed on WinSer2008 then you can have this issue.
The mp4 MIME settings are:
File name extension: .mp4
MIME type: video/mp4
The MIME type can be added via Web.config as well, just in case your IIS is on Azure:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
https://blogs.iis.net/bills/how-to-add-mime-types-with-iis7-web-config

IIS Express won't download .coffee files

I just enabled source maps because, sure why not, I'd like to try them out. However, I'm finding that IISExpress will not download .coffee files so it doesn't work.
I'm sure it's a simple web.config modification, I'm just not sure which one. How do I configure it to serve these?
All of IIS Express's configuration is done through the configuration files; in this case you want
C:\Users\[user]\Documents\IISExpress\config\applicationhost.config
In that file, there's a list of all of the static content types that IIS Express knows about and is willing to serve. You just need to add your extension to that list. The list starts about 1/2 down the file, in this XML element:
<staticContent lockAttributes="isDocFooterFileName">
It should be pretty obvious what to do from there: just map.coffee files to the correct mime type.
<mimeMap fileExtension=".coffee" mimeType="text/plain" />
This element is found within the system.webServer element, which is one of the ones that supports delegation to individual web.config files, so you should be able to add a similar XML block to your project's configuration file:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".coffee" mimeType="text/plain" />
</staticContent>
</system.webServer>

Roxy Fileman with CKEditor doesn't work after upload to server

I have to use any file manager on my website. I chose Roxy Fileman, because it is compatible with CKEditor, which is my main text editor. The problem is, everything works when i test it on my localhost, but after publishing it on server I get error message: "The page cannot be displayed because an internal server error has occurred." There's no more info... Have you guys any idea what I should do?
1) make sure Fileman folder is added to the directory
2) go to Fileman folder and in web.config add below code into the staticContent tag
<!--Cache static content for 24 hours-->
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="24.00:00:00" />
<!--Allow json file loading (used by Roxy Fileman)-->
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json" />
3) and finaly make sure Fileman has permission to write data
I had the same exact problem and after much research and diagnosing, this worked for me.
In the fileman directory, there is a web.config file. Open it in your text editor and you will see the following line:
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json"/>
</staticContent>
Delete it from the web.config and save. It is conflicting with something on the live server where this configuration is already being set. I hope this helps anyone.

What files can be downloaded from a website root directory?

If i have a page on my website called blah.aspx then there will be another file there called
blah.aspx.vb
I can browse to blah.aspx but if I try to browse to blah.aspx.vb, I'll get 'file not found' page.
If I change the name of blah.aspx.vb to blah.zip it can be downloaded via the browser.
If I change the name to blah.qaz I'll get the 'file not found' again.
I suspect that the server will not allow the .aspx.vb file to be downloaded but if it doesn't protect a .zip file why does it protect a made up .qaz or is that just a shortcoming of the browser?
Are there file extensions that a server will actively protect?
Are there file extensions it deliberately won't hide (e.g zip)?
What are the rules and where can you find them?
IIS 7 maps 'allowed' extensions (or extensions that it will handle) in the applicationhost.config file.
If you really want to allow a 'qaz' extension, you could add a mimeMap to add it as static content. Don't know what webserver you're using, but if you're on II7+, you should be able to add it to your web.config:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".qaz" mimeType="text/plain" />
</staticContent>
</system.webServer>
</configuration>
If you're on an earlier version of IIS, then it's a different ballgame. If you're on some other webserver, you'll have to search around for the configuration information, but most will have some configuration file that states which extensions they are ok serving.

Resources