...
Due historical reasons coming from the used frontend framework, POST requests containing file uploads are different as the above shown POSTs without files.
More information about the task API.
A POST with fileupload contains the entities attrbutes attributes not as JSON, but as plain form fields. This a known caveat.
Warning |
---|
Please change also the XLF file path to the file which should be uploaded.
Code Block | ||||
---|---|---|---|---|
| ||||
curl 'httpshttp://www.translate5.netlocaldev/editor/task/TASKID' -X PUTPOST \ -H 'Cookie: zfExtended=HERE_WILL_BE_YOUR_SESSION_ID_THEN' \ -F "format=jsontext" \ -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json' \ --data-urlencode 'data={"taskName":"New Task Name","entityVersion":123}'F "taskName=This is a import test" \ -F "sourceLang=de" \ -F "targetLang=it" \ -F "edit100PercentMatch=1" \ -F "lockLocked=1" \ -F "importUpload=@/PATH/TO/YOUR/FILE.xlf" |
On success this results in a JSON containing the importing task.