You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response that I am getting from agora is a 400 error: {'error': 'illegal_argument', 'exception': 'java.lang.IllegalArgumentException', 'timestamp': 1679065052094, 'duration': 1, 'error_description': 'file must be provided.'} fromServer: {'msg': 'The file was not uploaded successfully to agora server.'}
Even though the path to the file is valid, I get a True boolean when I test its validity of it by passing it in for os.path.exists().
Thanks for the reply. But that's not working. According to the official docs, what should be passed for the post-request body is the path to the file. However, that's not working as well, even though I verified that the path is valid.
I am uploading a file to the Agora server to reference it via its' URL when a user sends a message to their peer.
Here's how I structure the request that is sent to Agora's server:
pathToFile = 'C:\Users\gtori\OneDrive\Desktop\messaging_hud\users\files\testFile.png'
headers = {'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW', 'Authorization': 'Bearer token'}
agoraUrl = https://a41.chat.agora.io/orgName/appName/chatfiles
res = requests.post(agoraUrl, { file: pathToFile }, headers=headers)
The response that I am getting from agora is a 400 error:
{'error': 'illegal_argument', 'exception': 'java.lang.IllegalArgumentException', 'timestamp': 1679065052094, 'duration': 1, 'error_description': 'file must be provided.'} fromServer: {'msg': 'The file was not uploaded successfully to agora server.'}
Even though the path to the file is valid, I get a
True
boolean when I test its validity of it by passing it in foros.path.exists()
.I'm following Agora's documentation linked here under "Upload a file": https://docs.agora.io/en/agora-chat/restful-api/message-management?platform=unity#upload-a-file
Thanks for any input.
The text was updated successfully, but these errors were encountered: