themisir / upload.net

File upload services for .net projects
Apache License 2.0
1 stars 0 forks source link

any examples using minimal api ? #1

Open wilz055 opened 2 weeks ago

wilz055 commented 2 weeks ago

Could you please provide any examples using minimal api for file upload.

themisir commented 2 weeks ago

All the provided samples (code pieces, example implementation) should map 1:1 to minimal APIs. Just replace services with builder.Services and endpoints with app.Map....

wilz055 commented 2 weeks ago

I tried your examples, to upload file to s3, its throwing service not registered error in .net core 8.0. If you could add some sample code to consume, would be more helpful added

builder.Services.AddAmazonS3(builder.Configuration.GetSection("AmazonS3"));
services.AddUploadNet()
        .AddAwsS3Provider("public", options =>
        {
            options.BucketName = "public-images";
        });
like 

endpoint.MapPost( IFormFile file , StorageManager _storageManager) 
await _storageManager.CreateFile("public", "users/1553/profile.png", inputStream);