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
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');
[Here][php-curl] is the PHP wiki article on the “new” method
And here it is, in action
Yay now I can upload files from PHP [php-curl]: https://wiki.php.net/rfc/curl-file-upload