alexiscn / SynologyKit

Synology File Station SDK for Swift
MIT License
34 stars 6 forks source link

MD5 error #15

Open g-mocken opened 1 month ago

g-mocken commented 1 month ago

I have an idea for an app, which would use the MD5 command to check whether a file exists and is complete before uploading a fresh copy of the same file. But when trying out the sample app, the MD5 feature only seems to work sometimes. Most of the times I get:

"Error Code:599, response: success(Optional(38 bytes))"
No such task of the file operation

in the Xcode console (and only sometimes it prints the correct MD5 hash instead).

g-mocken commented 1 month ago

Extra quotes (hint came from here) in func checkTaskStatus seem to help: statusRequest.params["taskid"] = "\"\(task.taskid)\""

The Synology API guide also has extra quotes (%22) around the taskid in its example on page 104:

GET /webapi/entry.cgi?api=SYNO.FileStation.Compress&version=3&method=status&
taskid=%22FileStation_51CBB25CC31961FD%22