@@ -297,7 +297,7 @@ def _upload_job_result(
297
297
size = buf .getbuffer ().nbytes
298
298
logger .debug (f"Uploading { size } bytes result for job { job .job_uuid } with filename { filename } " )
299
299
start = time .time ()
300
- files = {"f " : (filename , buf )}
300
+ files = {"data " : (filename , buf )}
301
301
data = {"client" : json .dumps (self .clientinfo )}
302
302
if isinstance (job , ThumbnailJob | ThumbnailSourceJob | ImageConversionJob ):
303
303
# Image generating jobs needs a metadata object as well
@@ -398,7 +398,7 @@ def upload_file(self, path: Path, attribution: str, file_license: str) -> dict[s
398
398
399
399
# open file
400
400
with path .open ("rb" ) as fh :
401
- files = {"f " : (path .name , fh )}
401
+ files = {"file_data " : (path .name , fh )}
402
402
# build metadata
403
403
data = {
404
404
"attribution" : attribution ,
@@ -415,14 +415,14 @@ def upload_file(self, path: Path, attribution: str, file_license: str) -> dict[s
415
415
# doit
416
416
r = self .client .post (
417
417
self .base_url + "/api/v1/json/files/upload/" ,
418
- data = {"f_metadata " : json .dumps (data ), "client" : json .dumps (self .clientinfo )},
418
+ data = {"file_metadata " : json .dumps (data ), "client" : json .dumps (self .clientinfo )},
419
419
files = files ,
420
420
timeout = 30 ,
421
421
)
422
422
# create symlink to file in workdir
423
423
workpath = self .path / r .json ()["bma_response" ]["links" ]["downloads" ]["original" ][1 :]
424
424
if not workpath .exists ():
425
- workpath .parent .mkdir (exist_ok = True )
425
+ workpath .parent .mkdir (parents = True , exist_ok = True )
426
426
workpath .symlink_to (path )
427
427
428
428
return r .json () # type: ignore[no-any-return]
0 commit comments