Retrieving Twilio Programmable Messaging MMS and WhatsApp Media Files with PHP

In all of Twilio’s Helper Library SDKs, we include a convenient method for retrieving media files. However, we know that some of our customers prefer to design their applications without the use of Twilio’s Helper Libraries.

If you are using PHP for your application code, please avoid the use of PHP’s file_get_contents method for retrieving media from Twilio Media URLs. Twilio's Media URLs may redirect to a destination URL that is too long for this method to handle (over 1,024 characters), resulting in an error. Instead, please use PHP Curl for media data retrieval. Learn more here: How can I download an MMS media file with PHP?

Have more questions? Submit a request
Powered by Zendesk