I noticed that its image/jpg which causes this problem.
I simply replace the type as image/jpeg when the extension is jpg and it works like a charm.
//Getting path info
$contentType = pathinfo($saved_path, PATHINFO_EXTENSION);
if($contentType == 'jpg') $contentType="jpeg";
$content_Type = 'image/'.$contentType;
Add new column into InstallSchema.php for image
['nullable' => true],
Add Form type must be this
enctype="multipart/form-data" : No characters are encoded. This value is required when you are ...
You need to create a file "UpgradeData.php"
UpgradeData - this class will run when the module is upgraded to add/remove data from table.
will be located at app/code/Vendor/Module/Setup folder. The module install/upgrade script will run when you run the following command line:
php bin/magento setup:upgrade
Make sure to upgrade module version to ...
Had the same error on local environment.
The error was due to an nginx permissions error.
Running this on macOS with local brew services nginx.
Local dev env
brew services nginx, php7.2
Error in the /usr/local/var/log/nginx/error.log file was
[crit] 7566#0: *31067 open() "/usr/local/var/run/nginx/client_body_temp/0000000035" ...
This is not possible using the Magento 2 REST API. Up to Magento 2.2 REST API only supports single object calls at a given time for image calls. You need to call multiple calls for multiple images.
if you still wanted to upload multiple images, you can do it by calling that function in the looping structure.