mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
s3: use internal upload object url for uploading files
This commit is contained in:
@@ -81,7 +81,7 @@ namespace Notesnook.API.Controllers
|
||||
return BadRequest(new { error = "Storage limit exceeded." });
|
||||
}
|
||||
|
||||
var url = S3Service.GetUploadObjectUrl(userId, name);
|
||||
var url = S3Service.GetInternalUploadObjectUrl(userId, name);
|
||||
if (url == null) return BadRequest(new { error = "Could not create signed url." });
|
||||
|
||||
var httpClient = new HttpClient();
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Notesnook.API.Interfaces
|
||||
Task DeleteDirectoryAsync(string userId);
|
||||
Task<long> GetObjectSizeAsync(string userId, string name);
|
||||
string? GetUploadObjectUrl(string userId, string name);
|
||||
string? GetInternalUploadObjectUrl(string userId, string name);
|
||||
Task<string?> GetDownloadObjectUrl(string userId, string name);
|
||||
Task<MultipartUploadMeta> StartMultipartUploadAsync(string userId, string name, int parts, string? uploadId = null);
|
||||
Task AbortMultipartUploadAsync(string userId, string name, string uploadId);
|
||||
|
||||
@@ -160,6 +160,11 @@ namespace Notesnook.API.Services
|
||||
return this.GetPresignedURL(userId, name, HttpVerb.PUT);
|
||||
}
|
||||
|
||||
public string? GetInternalUploadObjectUrl(string userId, string name)
|
||||
{
|
||||
return this.GetPresignedURL(userId, name, HttpVerb.PUT, S3ClientMode.INTERNAL);
|
||||
}
|
||||
|
||||
public async Task<string?> GetDownloadObjectUrl(string userId, string name)
|
||||
{
|
||||
// var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync<IUserSubscriptionService>(SubscriptionServerTopics.UserSubscriptionServiceTopic);
|
||||
|
||||
Reference in New Issue
Block a user