public ArquivoController(WebApiUploadDownloadContext context, IHostingEnvironment env,
                          IFileServerProvider fileServerProvider)
 {
     _context            = context;
     _env                = env;
     _fileServerProvider = fileServerProvider;
 }
예제 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IFileServerProvider fileServerprovider)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            //else
            //{
            //    app.UseHsts();
            //}

            //app.UseHttpsRedirection();
            app.UseFileServerProvider(fileServerprovider);
            app.UseMvc();
        }
예제 #3
0
 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IFileServerProvider fileServerprovider)
 {
     if (env.IsDevelopment())
     {
         app.UseDeveloperExceptionPage();
     }
     app.UseStaticFiles();
     //app.UseFileServer(new FileServerOptions()
     //{
     //    FileProvider = new PhysicalFileProvider("C:\\recursos\\"),
     //    RequestPath = new PathString("/StaticFiles"),
     //    EnableDirectoryBrowsing = true // you make this true or false.
     //});
     app.UseSession();
     app.UseFileServerProvider(fileServerprovider);
     app.UseMvc(routes =>
     {
         routes.MapRoute(
             name: "default",
             template: "{controller=Authentication}/{action=LogIn}/{id?}");
     });
 }
 public static IApplicationBuilder UseFileServerProvider(this IApplicationBuilder application, IFileServerProvider fileServerprovider)
 {
     foreach (var option in fileServerprovider.FileServerOptionsCollection)
     {
         application.UseFileServer(option);
     }
     return(application);
 }
예제 #5
0
 public HomeController(IFileServerProvider fileServerProvider)
 {
     _fileServerProvider = fileServerProvider;
 }