diff options
author | Elmer Miroslav Mosher Golovin <miroslav@mishamosher.com> | 2023-04-26 16:26:21 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2023-04-26 20:59:39 +0200 |
commit | 7e036e4ebfc7b128c60c181db88a18c79b9c4a24 (patch) | |
tree | d47e233ffee0e9929d5d9ee2eb6b7acc18f4852d /recording | |
parent | d166a8b994dc393532fa7ea9bde87aacecd6ca57 (diff) |
Use a streaming POST request for recordings upload
Signed-off-by: Elmer Miroslav Mosher Golovin <miroslav@mishamosher.com>
Diffstat (limited to 'recording')
-rw-r--r-- | recording/src/nextcloud/talk/recording/BackendNotifier.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/recording/src/nextcloud/talk/recording/BackendNotifier.py b/recording/src/nextcloud/talk/recording/BackendNotifier.py index 0524889de..eff58caea 100644 --- a/recording/src/nextcloud/talk/recording/BackendNotifier.py +++ b/recording/src/nextcloud/talk/recording/BackendNotifier.py @@ -190,15 +190,11 @@ def uploadRecording(backend, token, fileName, owner): url = backend.rstrip('/') + '/ocs/v2.php/apps/spreed/api/v1/recording/' + token + '/store' - fileContents = None - with open(fileName, 'rb') as file: - fileContents = file.read() - # Plain values become arguments, while tuples become files; the body used to # calculate the checksum is empty. data = { 'owner': owner, - 'file': (os.path.basename(fileName), fileContents), + 'file': (os.path.basename(fileName), open(fileName, 'rb')), } multipartEncoder = MultipartEncoder(data) |