TempFileStorage 3.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TempFileStorage --version 3.1.0                
NuGet\Install-Package TempFileStorage -Version 3.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="TempFileStorage" Version="3.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TempFileStorage --version 3.1.0                
#r "nuget: TempFileStorage, 3.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 TempFileStorage as a Cake Addin
#addin nuget:?package=TempFileStorage&version=3.1.0

// Install TempFileStorage as a Cake Tool
#tool nuget:?package=TempFileStorage&version=3.1.0                

TempFileStorage

Easy .NET standard library for handling file-uploads

Just use ITempFileStorage to store your file during uploads, this will return a key for later use, for when you want to save your form.

Core package comes with In-Memory storage that is usefull for testing or non-multi server setups.

Installing TempFileStorage

You should install TempFileStorage with NuGet:

Install-Package TempFileStorage

Or via the .NET Core command line interface:

dotnet add package TempFileStorage

Usage

Add the following service to the container:

services.AddSingleton<ITempFileStorage, TempFileMemoryStorage>();

Register the Middleware in your Startup.cs to activate the request-middleware:

app.UseTempFiles(builder =>
{
    builder.Options.UploadFilePath = "/upload-file";
    builder.Options.DownloadFilePath = "/download-file";
});

SqlServer

Install the package TempFileStorage.SqlServer with NuGet:

Run the SQL-script install.sql on your DB-server.

Swap the TempFileMemoryStorage with TempFileSqlStorage

services.AddSingleton<ITempFileStorage>(c => new TempFileSqlStorage(Configuration.GetConnectionString("Database")));
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TempFileStorage:

Package Downloads
TempFileStorage.SqlServer

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.1.2 216 1/31/2024
3.1.1 1,979 1/9/2023
3.1.0 854 9/21/2022
3.0.0 1,920 6/17/2021
2.0.0 311 5/14/2021
1.0.0 663 11/15/2019