Netcore occasionally useful article: Netcore Item add MIME

Source: Internet
Author: User

First, Introduction

1, the system defaults to provide us with some of the file types of processing methods.

2, the system does not provide us with the processing of file types can not be used, for example: apk

3, you need to add mime, in order to access

4. The following is an example of adding APK access

Second, do not add mime when

1. Put an apk file in the static directory

2, enable Usestaticfiles (see the basic article to enable static files)

3, access to this file via HTTP, the results can not access

            App. Usestaticfiles ();

Third, after adding mime

1, add the MIME code in startup, note that Usestaticfiles replaces the original, instead of adding one.

2, re-visit, normal download

            // Add MIME            var New Fileextensioncontenttypeprovider ();            Provider. mappings[". apk""application/vnd.android.package-archive ";            App. Usestaticfiles (new  staticfileoptions            {                = provider            });

Netcore occasionally useful article: Netcore Item add MIME

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.