When taking a look onto the VELO-API, we can find this one here…
export function uploadImage(buffer) {
return mediaManager.upload(
"/myUploadFolder/subfolder",
buffer,
"myFileName.png",
{
"mediaOptions": {
"mimeType": "image/png",
"mediaType": "image"
},
"metadataOptions": {
"isPrivate": false,
"isVisitorUpload": false,
"context": {
"someKey1": "someValue1",
"someKey2": "someValue2"
}
}
}
);
}
Let’s say my buffer-source / buffer-data is the following…
buffer = data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAABcGlDQ1BpY2MAACjPlZG5S0NBEIc/EyWikRSmSGGRIloZ0SiinUS8QC2SCEZtkpdLyPF4LyJiK9gKFh6NV2Fjra1gLQiCF+JfYKVoI+E5mwQShBTOsjvf/nZm9gLbYlbLmc39kMsXjdBU0LsYXfI6XrDhwYlYTDP1ufBkhIb2/UCT8vd+VYv/WXsiaWrQ1Co8pulGUXhaeH69qCveF3ZrmVhC+EK415ADCj8pPV7hd8XpMttUTbcRCY0Lu4W96TqO17GWMXLCQ8K+XHZNq55H3cSZzC+ElS69C5MQUwTxMsME4wwzwKiMw/gJ0CczGuQHyvnzFCRXk1FnA4NV0mQo0ivqmlRPik+JnpSWlQgx9Qd/39ZMDQYqOziD0PJmWZ/d4NiF0o5l/ZxYVukU7K9wna/lF45h5Ev0nZrmOwLXFlze1LT4Hlxtg+dZjxmxsmSXbkul4OMcOqLQeQdty5V3q65z9giRTZi9hYND6JF418ovewhm0YKQ/LsAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+UCDBIBLfkt1mMAAIAASURBVHja7P15vH3JdReGrrX3uecOv6lHqSV1a7Iky7IlS8Y2GIzwIDCQOICZwuCEIbz38vKAT+BBHmEIz5CYF17y+CTkEwhTiMFg49hgIMTgITbCODa2sQFjy5Ylt0Zr6Ok33HuGXev9UbXW+q6q2ufeX3f/hm6dkn59z9mndg2rVq25VhHty77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77sy77c1cL3egD7cm/LLxsfoO+dnqF//Fe+cfziX/6e46OHLi230/Zg2k6LadouKaVFmuSIiY/GxeJ4uVweL5eHJ7xYHNFIS2IiEmEiYhIWEhIahIl5oERCRPkZCdNEUjBuIGKRlISZBhFJTAMRExNRIiJiJhYRIiEWIio/ikiilESGgQci4pSmKdcmEiFi5lxZEhGzkBAR8SApSZIkzANR7lyY80siJMTE+TdhotxW+e+QZBIqUyrvDVReIxIipkTCREIDMYmIlPHnuQqVUQglocRERElEJKVERCPzQMMwlDeJWAdGxCmlJEKi85IM7CGlJERMrP+nMhgmJqHkw+eROE8qiYjktSIeOFcVkZQmHngg5mEQEhGRiVmYhFlEUpLEAw9DnhgxiaTcJY9ElIaBKUlS0KWypnm4JIOITEQyMA2URESXqAxXhy9lvYmHgUVS0kpleQYFz8ADJUlkYOIMlgxukvxexhYhIeZhKJ/LmpOCjoQkMdEgkqc1DAMZ7HK9VPoaBh4kL30iXX3trYCm0FPRn5h5GHQuzKwLIELMTCLENNpYJS/cMJRpU14j4gxHA1ru05aDSCRJmtI03UopnRLJKSW6xcQrEV5LklWatutpm7ar09PNzZs3N//mX/zA2df/qT+++UVf/CX01777O+81GdqXe1T2AsBnSBER+rb/7q8OX/E1X308Xj64vFmtry0Pjh49vnLpiUTpiTSlJ8ZxfHxYjA8x0bEQHRLREQktiGRJREsiWhDRgpgXnBkLK+/UbqBLJqfIotTWfiP8nIndTNG68I5+VdI7/xKMZaZv6r1eN2VgLH3DfKXpqvzEEl5meJ+ceZQfnZdVg9Nx9yDc6bQzI4aZCsAuTsvn1OlFfzembsP2UYe2O+u7C/T153YI8VcmgLv9NUGrDyYErY2IOL7I3qFKKEWOyjIdFTAytMMVOCViq4+TYXxig1KBE7DBJ+1YXj4yzKHFk4mItsS0ZeEtCW1FZJOmtEppWgnRWZqmUyF5jok/JhN9bLNafezs7NbHps32Yyz86Vs3bjz3kz/yo8/9od/ztevf8Ju+lv70N38D7cvLt+wFgJdZGYhoEqEfe+8PLN74ts++xsRPnFy58iYheSKl9Pg4jq/lcXgtET1MRFeZ+DIxHeZXK+bQ4xX9h7OPX3ipGcO9K3dsivtyd8p9vYB3f3CShERkQyRnlOjmNKXr2+3m45Lkp7ar7b+9dfP6T2xXm/c/9clPfvL7v/ufXP+//Yk/OjHftwDcl+dR9qv5Ei//5W/6Wvqj3/wN9L7v/5GDx976+gcGHl57eOnk7ST0rvFg8Q4iehMTP0RMR5TlgwuVotk/rzFd+F3Vn6lRsz9jELOnQSIM7jgs7nAHzfwqW07fGHEXB91p6oXg/ovZxtxw0TJwp8CSUpokyY20TZ/YrFcfkEQ/uT5b/cTZres/sT7dPvnxD33403/lr/yFm+98xzvlP/kTf+RFn+e+3J3ymUJnX1ZFROjTH/zYwcHVw4cW48FrlydHn09C7xwXi3cQyRuJ+WFmPrpn46OLINbLh83fKWJ/e2PI/739cVzE6nPOa89jKaV4fV40uM2M54WuTXi/CKxu/he6uEZ8PpCez44I78x6d6pHxf9wW9q8EKWUNiLy7LTefny73bxv2kw/evP6c++9+cyNn/jB7/6uT7/iNU9M7/n3f+3zhvW+3P3y8qDAnwHlmY99gran68XhtUuvOjo5
....... and so on.........
As stated in the beginning of the BUFFER-DATA, this should be an IMAGE in PNG format.
But when i try to load it up, it always gets saved as TXT-file.
My question is now, why it does not save as PNG-file?
End of file-name is setted-up to —> “myFileName.png”
Media-type is setted-up to —> “image”
Mime-type is setted-up to —> “image/png”
But it gets still saved as TEXT-FILE, why ?