Cannot Upload a File through the API with the synchronous Parameter
User PeterWells is experiencing a 500 error when trying to upload a file through the API using PowerShell with the synchronous=1 parameter. The API call works correctly without this parameter.
PeterWells provided the PowerShell code, which appears to be correct according to zogstrip.
The error log from /var/www/discourse/logs shows an error in uploads_controller.rb when creating an upload, but does not provide a clear cause for the issue.
Another user, adam_beers, is experiencing the same issue.
I have been trying to add uploaded files through the API using PowerShell. The call appears to work correctly when I use it to upload an image file, but if I try the same call with a synchronous=1 parameter added, it returns with a 500 error.
Based on a previous topic, I had hoped to use the synchronous feature to get the file url.
$urlTo is the url for the site, $loginTo is the APIkey and username. The $r at the top is the response from downloading the image from another site to a file called $fileOut