diff --git a/src/App/Pages/Send/SendAddEditPage.xaml b/src/App/Pages/Send/SendAddEditPage.xaml
index 1ff2b8f77..963312d6b 100644
--- a/src/App/Pages/Send/SendAddEditPage.xaml
+++ b/src/App/Pages/Send/SendAddEditPage.xaml
@@ -215,7 +215,7 @@
Clicked="ChooseFile_Clicked" />
@@ -513,4 +513,4 @@
-
\ No newline at end of file
+
diff --git a/src/App/Pages/Send/SendAddEditPageViewModel.cs b/src/App/Pages/Send/SendAddEditPageViewModel.cs
index b729d29ce..e3624779e 100644
--- a/src/App/Pages/Send/SendAddEditPageViewModel.cs
+++ b/src/App/Pages/Send/SendAddEditPageViewModel.cs
@@ -327,7 +327,7 @@ namespace Bit.App.Pages
AppResources.AnErrorHasOccurred);
return false;
}
- if (FileData.Length > 104857600) // 100 MB
+ if (FileData.Length > 524288000) // 500 MB
{
await _platformUtilsService.ShowDialogAsync(AppResources.MaxFileSize,
AppResources.AnErrorHasOccurred);
diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx
index 326fa92c1..806ab4c2f 100644
--- a/src/App/Resources/AppResources.resx
+++ b/src/App/Resources/AppResources.resx
@@ -927,6 +927,9 @@
Maximum file size is 100 MB.
+
+
+ Maximum file size is 500 MB.
You cannot use this feature until you update your encryption key.
diff --git a/src/Core/Abstractions/IApiService.cs b/src/Core/Abstractions/IApiService.cs
index 0f79493bd..4edeba2fd 100644
--- a/src/Core/Abstractions/IApiService.cs
+++ b/src/Core/Abstractions/IApiService.cs
@@ -56,7 +56,11 @@ namespace Bit.Core.Abstractions
Task GetSendAsync(string id);
Task PostSendAsync(SendRequest request);
+ Task PostFileTypeSendAsync(SendRequest request);
+ Task PostSendFileAsync(string sendId, string fileId, MultipartFormDataContent data);
+ [Obsolete("Mar 25 2021: This method has been deprecated in favor of direct uploads. This method still exists for backward compatibility with old server versions.")]
Task PostSendFileAsync(MultipartFormDataContent data);
+ Task RenewFileUploadUrlAsync(string sendId, string fileId);
Task PutSendAsync(string id, SendRequest request);
Task PutSendRemovePasswordAsync(string id);
Task DeleteSendAsync(string id);
diff --git a/src/Core/Abstractions/IAzureFileUpoadService.cs b/src/Core/Abstractions/IAzureFileUpoadService.cs
new file mode 100644
index 000000000..fe38ffb4f
--- /dev/null
+++ b/src/Core/Abstractions/IAzureFileUpoadService.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Bit.Core.Abstractions
+{
+ public interface IAzureFileUploadService
+ {
+ Task Upload(string uri, byte[] data, Func> renewalCallback);
+ }
+}
diff --git a/src/Core/Abstractions/IFileUploadService.cs b/src/Core/Abstractions/IFileUploadService.cs
new file mode 100644
index 000000000..b0da4e170
--- /dev/null
+++ b/src/Core/Abstractions/IFileUploadService.cs
@@ -0,0 +1,9 @@
+using System.Threading.Tasks;
+using Bit.Core.Models.Domain;
+using Bit.Core.Models.Response;
+
+namespace Bit.Core.Abstractions {
+ public interface IFileUploadService {
+ Task UploadSendFileAsync(SendFileUploadDataResponse uploadData, CipherString fileName, byte[] encryptedFileData);
+ }
+}
diff --git a/src/Core/Enums/FileUploadType.cs b/src/Core/Enums/FileUploadType.cs
new file mode 100644
index 000000000..8aeb51072
--- /dev/null
+++ b/src/Core/Enums/FileUploadType.cs
@@ -0,0 +1,9 @@
+using System;
+namespace Bit.Core.Enums
+{
+ public enum FileUploadType
+ {
+ Direct = 0,
+ Azure = 1,
+ }
+}
diff --git a/src/Core/Models/Response/SendFileUploadDataResponse.cs b/src/Core/Models/Response/SendFileUploadDataResponse.cs
new file mode 100644
index 000000000..8ea79ae0e
--- /dev/null
+++ b/src/Core/Models/Response/SendFileUploadDataResponse.cs
@@ -0,0 +1,12 @@
+using System;
+using Bit.Core.Enums;
+
+namespace Bit.Core.Models.Response
+{
+ public class SendFileUploadDataResponse
+ {
+ public string Url { get; set; }
+ public FileUploadType FileUploadType { get; set; }
+ public SendResponse SendResponse { get; set; }
+ }
+}
diff --git a/src/Core/Services/ApiService.cs b/src/Core/Services/ApiService.cs
index 8f5245593..f0ea50bbd 100644
--- a/src/Core/Services/ApiService.cs
+++ b/src/Core/Services/ApiService.cs
@@ -223,9 +223,19 @@ namespace Bit.Core.Services
public Task PostSendAsync(SendRequest request) =>
SendAsync(HttpMethod.Post, "/sends", request, true, true);
+ public Task PostFileTypeSendAsync(SendRequest request) =>
+ SendAsync(HttpMethod.Post, "/sends/file/v2", request, true, true);
+
+ public Task PostSendFileAsync(string sendId, string fileId, MultipartFormDataContent data) =>
+ SendAsync(HttpMethod.Post, $"/sends/{sendId}/file/{fileId}", data, true, false);
+
+ [Obsolete("Mar 25 2021: This method has been deprecated in favor of direct uploads. This method still exists for backward compatibility with old server versions.")]
public Task PostSendFileAsync(MultipartFormDataContent data) =>
SendAsync(HttpMethod.Post, "/sends/file", data, true, true);
+ public Task RenewFileUploadUrlAsync(string sendId, string fileId) =>
+ SendAsync