![]() Request = (fileMetadata, stream, file.ContentType) ![]() Using (var stream = file.OpenReadStream()) Var fileMetadata = new 3.Data.File() įileMetadata.Name = Path.GetFileName(fileName) įileMetadata.MimeType = file.ContentType įileMetadata.Parents = new List() Var fileName = GetUniqueFileName(file.FileName) Public static async Task UploadFileAsync(IFormFile file) Return new DriveService(new BaseClientService.Initializer() New FileDataStore(credPath, true)).Result Ĭonsole.WriteLine("Credential file saved to: " + credPath) GoogleClientSecrets.Load(stream).Secrets, New FileStream("client_secret.json", FileMode.Open, FileAccess.Read))Ĭredential = GoogleWebAuthorizationBroker.AuthorizeAsync( 2.GoogleWebAuthorizationBroker.AuthorizeAsync(ClientSecrets clientSecrets, IEnumerable scopes, string user, CancellationToken taskCancellationToken, IDataStore dataStore, ICodeReceiver codeReceiver) 2.GoogleWebAuthorizationBroker.AuthorizeAsync(Initializer initializer, IEnumerable scopes, string user, CancellationToken taskCancellationToken, IDataStore dataStore, ICodeReceiver codeReceiver) 2.AuthorizationCodeInstalledApp.AuthorizeAsync(string userId, CancellationToken taskCancellationToken) g_AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) ResourceInvoker.g_Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) ResourceInvoker.InvokeFilterPipelineAsync() ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) ResourceInvoker.g_Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) ControllerActionInvoker.InvokeInnerFilterAsync() ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) ![]() ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) ControllerActionInvoker.g_Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) ControllerActionInvoker.g_Awaited|12_0(ControllerActionInvoker invoker, ValueTask actionResultValueTask) ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object arguments) ![]() 2.LocalServerCodeReceiver.ReceiveCodeAsync(AuthorizationCodeRequestUrl url, CancellationToken taskCancellationToken)Į+GoogleDrive.GetService() in Files.csĮ+GoogleDrive.UploadFileAsync(IFormFile file) in Files.csĮ(User_BugReportViewModel model) in BugReportController.cs NotSupportedException: Failed to launch browser with "" for authorization. GetResultCore(bool waitCompletionNotification) (Failed to launch browser with "" for authorization. An unhandled exception occurred while processing the request.ĪggregateException: One or more errors occurred.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |