diff --git a/HTTP2FileStreams.csproj b/HTTP2FileStreams.csproj
index bc4fb70..e6bf24d 100644
--- a/HTTP2FileStreams.csproj
+++ b/HTTP2FileStreams.csproj
@@ -12,4 +12,8 @@
+
+
+
+
diff --git a/Program.cs b/Program.cs
index b2f90e9..09455c1 100644
--- a/Program.cs
+++ b/Program.cs
@@ -13,6 +13,7 @@ public class Program
{
endpointOptions.Protocols = HttpProtocols.Http2;
});
+ options.Limits.MaxRequestBodySize = null;
});
builder.Services.AddControllers();
diff --git a/UploadController.cs b/UploadController.cs
index 5e20f6f..cf17a4b 100644
--- a/UploadController.cs
+++ b/UploadController.cs
@@ -7,17 +7,15 @@ namespace HTTP2FileStreams;
public class UploadController : ControllerBase
{
[HttpPost]
- [DisableFormValueModelBinding] // Отключаем стандартный парсинг формы
+ [DisableFormValueModelBinding]
public async Task Upload()
{
- // Получаем имя файла из заголовка
var fileName = Request.Headers["X-File-Name"].ToString();
if (string.IsNullOrEmpty(fileName))
return BadRequest("File name header is missing");
fileName = Uri.UnescapeDataString(fileName);
-
- // Потоковая запись файла
+
if (!Directory.Exists("Uploads"))
Directory.CreateDirectory("Uploads");