Skip to content

Inconsistent supported media types in client.media.upload(): .wav rejected, .mpeg accepted but not listed in error message #295

@VasylKolomiiets

Description

@VasylKolomiiets

Description

When calling client.media.upload() in the Plivo Python SDK, I receive an error that only image files (JPG, JPEG, PNG and PDF) are allowed, despite documentation and SDK code indicating support for audio/video types.

Steps to Reproduce

  1. Install the Plivo Python SDK:

     pip install plivo
  2. Attempt to upload a WAV file:

from plivo import RestClient

client = RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
client.media.upload(["example.wav", ])
  1. Observe the error:
{
  "error": "File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF"
}
  1. Attempt to upload an MPEG file:
client.media.upload(["example.mpeg", ])
  1. The upload succeeds and do not produce listed error message.

Expected Behavior

  • WAV uploads are accepted per the documentation.
  • MPEG uploads succeed in practice and should be recognized in the error message.
  • The SDK error message and documentation should list all supported MIME types.

Actual Behavior

  • WAV uploads are rejected while only listing image and PDF types.
  • MPEG uploads succeed despite not being mentioned in the error output.

Environment

  • plivo-python version: latest
  • Python version: 3.12
  • Operating System: Windows10

References

Plivo Media API documentation
SDK source with error logic

Image

Suggested Fix

Update the SDK to include audio/video extensions (wav, mpeg, etc.) in the allowed list and error message.
Or clarify documentation if certain formats like wav are not intended to be accepted.

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