Closed Maverick1983 closed 3 years ago
downloadToFile requires 2 argiments: MessageMedia array and path to file. You provided only first argument with array.
Should be something like this:
downloadToFile?data["media"]["_"]=inputMediaUploadedDocument&data["media"]["file"]["_"]=inputFile&data["media"]["file"]["id"]=5742225891161704365&data["media"]["file"]["name"]=test.txt&data["file"]=path/to/output/text.txt
I use this
downloadToFile?data["media"]["_"]=inputMediaUploadedDocument&data["media"]["file"]["_"]=inputFile&data["media"]["file"]["id"]=5742225891161704365&data["media"]["file"]["name"]=test.txt
I receved this response
{ "success": false, "errors": [ { "exception": "ArgumentCountError", "message": "Too few arguments to function danog\\MadelineProto\\InternalDoc::downloadToFile(), 1 passed in /app-host-link/src/Controllers/AbstractApiController.php on line 161 and at least 2 expected", "file": "/app-host-link/vendor/danog/madelineproto/src/danog/MadelineProto/InternalDoc.php", "line": 4878, "code": 0, "backtrace": [ { "file": "/app-host-link/src/Controllers/AbstractApiController.php", "line": 161, "function": "downloadToFile", "class": "danog\\MadelineProto\\InternalDoc", "type": "->", "args": [ { "\"media\"": { "\"_\"": "inputMediaUploadedDocument", "\"file\"": { "\"_\"": "inputFile", "\"id\"": "5742225891161704365", "\"name\"": "test.txt" } } } ] }