Consistently receiving 500 error posting to media/upload


#1

Hello there,

We are currently in the middle of a platform migration from Windows to Linux servers.

We use the media/upload endpoint (https://upload.twitter.com/1.1/media/upload.json) and have noticed that all of our deployments on Linux servers are consistently getting 500 Internal Server Error responses.

I have no idea if the environment is the problem, but a 500 Internal Server Error response would normally indicate a problem on the 3rd party side.

Are there any known issues at the moment?

Thanks,
Naomi


#2

To follow up, I have just succesfully managed to post to media/upload from a Linux box.

The issue was with line endings.

We were using the PHP constant PHP_EOL. On Windows this resolves to \r\n and on Linux \n. Changing the PHP_EOL usage to "\r\n" fixed the issue.


#3

Glad to hear you figured it out - thanks for sharing the solution.