From 5cbb3e8705f51337c6455ecb5dc7004abf82bd89 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 14 Jul 2016 07:44:58 +0600 Subject: CLOUD: Add Storage::uploadStreamSupported() Box uses POST multipart/form requests for uploading. Such requests could be sent with libcurl if we either have a file available or a buffer with this file's contents. SavesSyncRequest was using Storage::upload(ReadStream *), which couldn't be implemented in BoxStorage. Thus I've added a method to test whether such upload is supported and, if it's not, SavesSyncRequest uses the other. --- backends/cloud/storage.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/cloud/storage.cpp') diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp index 2cf851f3ba..110c97ad9c 100644 --- a/backends/cloud/storage.cpp +++ b/backends/cloud/storage.cpp @@ -85,6 +85,10 @@ Networking::Request *Storage::upload(Common::String remotePath, Common::String l return upload(remotePath, f, callback, errorCallback); } +bool Storage::uploadStreamSupported() { + return true; +} + Networking::Request *Storage::streamFile(Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) { //most Storages use paths instead of ids, so this should work return streamFileById(path, callback, errorCallback); -- cgit v1.2.3