SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site,, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

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