in magento admin dashboard i unable to upload image due to flash player down. Please advise the option for adding of product images.
-
Please check this post if it helps! https://magento.stackexchange.com/questions/53352/magento-1-9-no-upload-image-buttons/53357 – Bhaumik Upadhyay Jan 16 '21 at 08:47
2 Answers
This appears to be a duplicate question
Answer:
Flash uploader was removed to being insecure and replaced with javascript uploader. Please apply the correct patch 8788 or update the store to 1.9.4.5 / OpenMage Project to avoid further disruption.
- 768
- 4
- 18
I just built a basic Node.js CLI tool for image uploading based on this repo/module. This is for a legacy install that is still running 1.5x and is full of gremlins that prevent patching from working properly. It uses the old SOAP API.
I used Commander to add CLI options.
I used Pkg to create executables.
It's a pretty simple project that allows non-technical users to quickly add images to a product by SKU.
'use strict';
const Mage = require('./node_modules/magento');
const fs = require('fs');
const path = require('path');
const { program } = require('commander');
program
.version('0.1')
.option('-s, --sku <sku>', 'Base SKU to upload to')
.option('-f, --file <file>', 'Image filename')
.option('-l, --label <label>', 'Image label')
program.parse(process.argv);;
const options = program.opts();
function mageUpload() {
var session = new Mage({
host: 'www.example.com',
port: 80,
path: '/api/xmlrpc',
login: 'yourlogin',
pass: 'yourpassword'
})
return session.login(function(err, sessId) {
if (err) {
console.log('error on login', err);
return;
}
var filename = options.file;
var image = fs.readFileSync(filename);
var base64img = image.toString('base64');
session.catalogProductAttributeMedia.create({
product: options.sku,
data: {
file: {
content: base64img,
mime: 'image/jpeg',
name: path.parse(filename).name
},
label: options.label,
types: [],
exclude: '0'
}
}, function(self, result) {
console.log(self);
console.log(result);
})
})
}
mageUpload();
- 4,648
- 3
- 32
- 58
-
Just going to add that there is a bug with this approach and I haven't tracked it down precisely yet. It may be related to the
xmlrpcdependency of themagentonpm module, or it might just be a server resource configuration error.When I upload images over a certain size, I get an error coming from
xmlrpcunable to parse theTITLEelement, which tells me that the SOAP API response is throwing some kind of error and it's in the form of an HTML page, which cannot be parsed properly byxmlrpc.I suspect the PHP config has some inadequate resources configured.
– pspahn Jan 20 '21 at 17:48