.net core download files in other formats

         app.UseStaticFiles (); 

            app.UseStaticFiles ( new new StaticFileOptions 
            { 
                // FileProvider = new new PhysicalFileProvider (Directory.GetCurrentDirectory ()),
                 // setting does not restrict the content-type setting can download all types of files, but does not recommend such a setting, because unsafe
                 // the following settings can be downloaded and nupkg apk file types 
                ContentTypeProvider = new new FileExtensionContentTypeProvider ( new new the Dictionary < String , String > 
                { 
                      { " .apk " , " file application / vnd.android.package-Archive " }
                    ,{".iso","application/octet-stream" }

                })
            });

 Source: https://www.cnblogs.com/damsoft/p/9529525.html

Guess you like

Origin www.cnblogs.com/enych/p/11733702.html