New answers tagged

0

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;


1

Add new column into InstallSchema.php for image ->addColumn( 'img', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 255, ['nullable' => true], 'Image' ) Add Form type must be this enctype="multipart/form-data" : No characters are encoded. This value is required when you are ...


0

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 ...


0

The fileId for the the following line is wrong. $uploaderFactory = $this->uploaderFactory->create(['fileId' => 'npwp_attachment']); It needs to match the name attribute on the input field.


0

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 macOS brew services nginx, php7.2 Magento 2.3.4 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" ...


0

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.


Top 50 recent answers are included