ShareX/ShareX.UploadersLib/FileUploaders/GoogleCloudStorage.cs

40 lines
1.2 KiB
C#
Raw Normal View History

2018-04-20 09:30:56 +12:00
using System.Collections.Generic;
using System.IO;
namespace ShareX.UploadersLib.FileUploaders
{
public class GoogleCloudStorageNewFileUploaderService : FileUploaderService
{
public override FileDestination EnumValue { get; } = FileDestination.GoogleCloudStorage;
public override bool CheckConfig(UploadersConfig config)
{
return true;
}
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
{
return new GoogleCloudStorage
{
APIKey = "null"
};
}
}
public sealed class GoogleCloudStorage : FileUploader
{
public string APIKey { get; set; }
2018-04-20 09:48:59 +12:00
public string bucket { get; set; }
2018-04-20 09:30:56 +12:00
public override UploadResult Upload(Stream stream, string fileName)
{
2018-04-20 09:48:59 +12:00
string uploadurl = $"https://www.googleapis.com/upload/storage/v1/b/{bucket}/o";
string objecturl = $"https://www.googleapis.com/upload/storage/v1/b/{bucket}/o/{fileName}/acl";
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("key", APIKey);
2018-04-20 09:30:56 +12:00
return null;
}
}
}