mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 07:43:37 +00:00
Send azure upload (#1334)
* Add direct upload api endpoints * Create azure upload service * Update max file size * Update send file upload test * Move internationalization string to correct document * Allow for one shot blob uploads * Remove unused helper * Use FileUploadService Fallback to legacy method on old server implementations.
This commit is contained in:
@@ -223,9 +223,19 @@ namespace Bit.Core.Services
|
||||
public Task<SendResponse> PostSendAsync(SendRequest request) =>
|
||||
SendAsync<SendRequest, SendResponse>(HttpMethod.Post, "/sends", request, true, true);
|
||||
|
||||
public Task<SendFileUploadDataResponse> PostFileTypeSendAsync(SendRequest request) =>
|
||||
SendAsync<SendRequest, SendFileUploadDataResponse>(HttpMethod.Post, "/sends/file/v2", request, true, true);
|
||||
|
||||
public Task PostSendFileAsync(string sendId, string fileId, MultipartFormDataContent data) =>
|
||||
SendAsync<MultipartFormDataContent, object>(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<SendResponse> PostSendFileAsync(MultipartFormDataContent data) =>
|
||||
SendAsync<MultipartFormDataContent, SendResponse>(HttpMethod.Post, "/sends/file", data, true, true);
|
||||
|
||||
public Task<SendFileUploadDataResponse> RenewFileUploadUrlAsync(string sendId, string fileId) =>
|
||||
SendAsync<object, SendFileUploadDataResponse>(HttpMethod.Get, $"/sends/{sendId}/file/{fileId}", null, true, true);
|
||||
|
||||
public Task<SendResponse> PutSendAsync(string id, SendRequest request) =>
|
||||
SendAsync<SendRequest, SendResponse>(HttpMethod.Put, $"/sends/{id}", request, true, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user