PHP file upload to slack

13 APR 2016
•
1 min read

So I don’t know why this one took me this long to find, but I spent a long time today trying to figure out why my PHP script wasn’t uploading my file I wanted to slack. I had the string to send to slack correct, but every time I tried I was getting a no_file_content error.

I was using the, apparently now, old method of referencing a file for POST-back. That is $file = '@/path/to/file.png'

Here is the new method, in case any one else had as much trouble as I did finding it $file = new CurlFile('filename.png', 'image/png');