uploadAttachment error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abidoss
    Senior Member
    • Mar 2023
    • 245

    #1

    uploadAttachment error

    Hello, why am I unable to upload an image, while PDF files upload without any issues?

    uploadAttachment: function (name, type, contentBase64, callback) {
    Espo.Ajax.postRequest('Attachment', {
    name,
    type,
    role: 'Attachment',
    relatedType: 'Document',
    field: 'file',
    file: 'data:' + type + ';base64,' + contentBase64
    }).then(callback).catch((err) => {
    console.error(err);
    $('#messageErreur').html('Erreur lors de l\'upload.').css('color', 'red');
    callback(null);
    });
    },


    Click image for larger version

Name:	image.png
Views:	13
Size:	167.0 KB
ID:	119328
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1703

    #2
    As the message says, the file type is not allowed in your upload field. You may configure that in the field in entity manager yourself.
    I would like to mention also the filename, which contains a space before the first parenthese. There are servers, that do not handle spaces in file names.

    Comment

    Working...