How to upload the file to Synology NAS with Tasker?

26 Views Asked by At

I am trying to upload the file to my Synology NAS (DSM 4.5). Here is the API description. I am able to upload the file with Postman. But when I do it with Tasker, I am getting Invalid parameter error.

Here is the tasker code -

HTTP Request [ 
 Method: POST 
 URL: http://192.168.1.5:5000/webapi/DownloadStation/task.cgi 
 Body: api=SYNO.DownloadStation.Task&version=3&method=create
 File To Send: file:%TorrentFile1 
 Timeout (Seconds): 30 
 Use Cookies: On 
 Structure Output (JSON, etc): On 
 Continue Task After Error:On ]

Here is the console log of Postman:

POST /webapi/DownloadStation/task.cgi HTTP/1.1
User-Agent: PostmanRuntime/7.36.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 7bb5709b-2f2c-4137-873b-3439efcebfc4
Host: 192.168.1.5:5000
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------806005720677301305684965
Cookie: id=XoK2.VRFtkJyMA2G6N03829
Content-Length: 16017

----------------------------806005720677301305684965
Content-Disposition: form-data; name="api"
SYNO.DownloadStation.Task
----------------------------806005720677301305684965
Content-Disposition: form-data; name="version"
3
----------------------------806005720677301305684965
Content-Disposition: form-data; name="method"
create
----------------------------806005720677301305684965
Content-Disposition: form-data; name="file"; filename="1.torrent"
<1.torrent>
----------------------------806005720677301305684965--

and here is the captured request from the Tasker:

POST /webapi/DownloadStation/task.cgi HTTP/1.1
Cookie: id=FI1.alUbM8kvsA2G6N03829
User-Agent: Tasker/6.2.22 (Android/10)
Content-Type: multipart/form-data; boundary=joaomgcdTaskerMOTHERFOCKERMUAHAHA
Content-Length: 5615
Host: 192.168.1.5:5000
Connection: Keep-Alive
Accept-Encoding: gzip

--joaomgcdTaskerMOTHERFOCKERMUAHAHA
Content-Disposition: form-data; name="api"
Content-Type: text/plain

SYNO.DownloadStation.Task
--joaomgcdTaskerMOTHERFOCKERMUAHAHA
Content-Disposition: form-data; name="method"
Content-Type: text/plain

create
--joaomgcdTaskerMOTHERFOCKERMUAHAHA
Content-Disposition: form-data; name="version"
Content-Type: text/plain

3
--joaomgcdTaskerMOTHERFOCKERMUAHAHA
Content-Disposition: form-data; name="file"; filename="1.torrent"
Content-Type: application/x-bittorrent
Content-Transfer-Encoding: binary

d13:announce-listll22:udp://opentor.net...

I see no difference.

What should I check or try?

0

There are 0 best solutions below