Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

AngeloArchiveProjects/UploadFileCustomExtensions

Repository files navigation

Upload Files Custom Extensions

If you like this repository, please drop a ⭐ on Github!

Installation

The library is available on NuGet or run the following command in the .NET CLI:

dotnet add package UploadFileCustomExtensions

Configuration to add to the appsettings.json file

"AppSettings": {
  "StorageFolder": ""
}

Registering services at Startup

public Startup(IConfiguration configuration)
{
  Configuration = configuration;
}

public IConfiguration Configuration { get; }
	
public void ConfigureServices(IServiceCollection services)
{
  services.AddBusinessLayerServices();  
  services.AddDataAccessLayerRegistration();

  services.AddStorageProviderService(Configuration);
}

Example of the image request

public class ImageRequest
{
    public IFormFile File { get; set; }
    public string Description { get; set; }
}

To keep in mind

At the moment this library only allows uploading images to file systems (supported extensions: jpeg, png)

Contributing

Contributions and/or suggestions are always welcome.

Inspired by

Marco Minerva Project