UFile.PartialUploader 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package UFile.PartialUploader --version 1.1.0                
NuGet\Install-Package UFile.PartialUploader -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UFile.PartialUploader" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UFile.PartialUploader --version 1.1.0                
#r "nuget: UFile.PartialUploader, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install UFile.PartialUploader as a Cake Addin
#addin nuget:?package=UFile.PartialUploader&version=1.1.0

// Install UFile.PartialUploader as a Cake Tool
#tool nuget:?package=UFile.PartialUploader&version=1.1.0                

The UFile library facilitates the uploading and processing of large files by handling them in smaller chunks. It provides functionality to save chunks, retry failed uploads, merge chunks into the final file, and store the completed file in a specified directoryThis approach is particularly useful for improving upload reliability and efficiency, especially for large files or unstable network conditions.

Examples

dotnet add package UFile.PartialUploader
public static IServiceCollection AddServices(this IServiceCollection services, IConfiguration conf)
{
    // Adds the UFile service to the specified service collection.
    services.AddUFile("App_Data", "tmp");

    return services;
}

    [Route("api/[controller]")]
    [ApiController]
    public class FileController(IUFileService uFileService) : ControllerBase
    {
        [HttpPost("upload")]
        public async Task<IActionResult> Upload() => StatusCode((int)await uFileService.UploadChunkFiles(Request));
    }

npm install partial-uploader

const file = event.target.files[0];

uploadFile = (file: File) => uploadWithPartialFile("/File/upload", file, 
    //you can add header here
    { "Authorization": `Bearer ${token}` });

let uploadResponse = await uploadFile(file);
if (uploadResponse.success)
{
    // your file will be inside the folder at this location
    const path = 'App_Data/tmp/' + uploadResponse.id;
}

    var fileInfo = UFileHelper.GetFileInfo(tempFolderId);

// Server Side Upload

    public class Test(IUFileService uFileService)
    {
        public async Task Upload()
        {
            var path = Path.Combine(Directory.GetCurrentDirectory(), "App_Data", "path/to/your/file.txt");

            var res = await UploadWithPartialFileAsync("https://example.com/upload", path, new Dictionary<string, string>
            {
                { "Authorization", "Bearer your_token" }
            });
        }
    }

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 153 10/4/2024
1.1.2 73 10/4/2024
1.1.1 78 10/4/2024
1.1.0 75 10/4/2024
1.0.9 78 10/4/2024
1.0.8 83 10/4/2024
1.0.7 190 6/16/2024
1.0.6 107 6/12/2024
1.0.5 116 6/2/2024
1.0.4 118 6/2/2024
1.0.3 103 6/2/2024
1.0.2 99 6/2/2024
1.0.1 96 6/2/2024
1.0.0 92 5/28/2024