Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Invalid response for photos.saveMessagesPhoto request #11

Description

@viktor02
19:12:55 [_vkApi_call] : [ERROR] {"error":{"error_code":100,"error_msg":"One of the parameters specified was missing or invalid: file is undefined","request_params":[{"key":"title","value":"Voice message"},{"key":"v","value":"5.67"},{"key":"method","value":"docs.save"},{"key":"oauth","value":"1"}]}}
19:12:55 [callback_handleEvent] : [ERROR] exception 'Exception' with message 'Invalid response for docs.save request' in /home/admin/web/public_html/weatherapp/www/api/vk_api.php:69
Stack trace:
#0 /home/admin/web/public_html/weatherapp/www/api/vk_api.php(45): _vkApi_call('docs.save', Array)
#1 /home/admin/web/public_html/weatherapp/www/bot/bot.php(41): vkApi_docsSave(NULL, 'Voice message')
#2 /home/admin/web/public_html/weatherapp/www/bot/bot.php(11): _bot_uploadVoiceMessage(189957065, '/home/admin/web...')
#3 /home/admin/web/public_html/weatherapp/www/index.php(56): bot_sendMessage(189957065)
#4 /home/admin/web/public_html/weatherapp/www/index.php(32): _callback_handleMessageNew(Array)
#5 /home/admin/web/public_html/weatherapp/www/index.php(18): callback_handleEvent()
#6 {main}

При исправлении ошибки в CURLfile (недостаточно аргументов)
curl_setopt($curl, CURLOPT_POSTFIELDS, array('file' => new CURLfile($file_name)));
=>
curl_setopt($curl, CURLOPT_POSTFIELDS, array('file' => new CURLfile($file_name, mime_content_type($file_name), 'file')));
Ошибка в логах меняется на

19:15:42 [callback_handleEvent] : [ERROR] exception 'Exception' with message 'Invalid response for photos.saveMessagesPhoto request' in /home/admin/web/public_html/weatherapp/www/api/vk_api.php:69
Stack trace:
#0 /home/admin/web/public_html/weatherapp/www/api/vk_api.php(31): _vkApi_call('photos.saveMess...', Array)
#1 /home/admin/web/public_html/weatherapp/www/bot/bot.php(29): vkApi_photosSaveMessagesPhoto('[]', 849124, '8bc76748718508b...')
#2 /home/admin/web/public_html/weatherapp/www/bot/bot.php(8): _bot_uploadPhoto(189957065, '/home/admin/web...')
#3 /home/admin/web/public_html/weatherapp/www/index.php(56): bot_sendMessage(189957065)
#4 /home/admin/web/public_html/weatherapp/www/index.php(32): _callback_handleMessageNew(Array)
#5 /home/admin/web/public_html/weatherapp/www/index.php(18): callback_handleEvent()
#6 {main}

Что не так?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions