All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lib.xp.examples.portal.getMultipartForm.js Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
var portalLib = require('/lib/xp/portal');
var assert = require('/lib/xp/testing');

// BEGIN
var result = portalLib.getMultipartForm();
log.info('Multipart form %s', result);
// END

// BEGIN
// Multipart-form returned.
var expected = {
    'item1': {
        'name': 'item1',
        'fileName': 'item1.jpg',
        'contentType': 'image/png',
        'size': 10
    },
    'item2': [
        {
            'name': 'item2',
            'fileName': 'image1.png',
            'contentType': 'image/png',
            'size': 123
        },
        {
            'name': 'item2',
            'fileName': 'image2.jpg',
            'contentType': 'image/jpeg',
            'size': 456
        }
    ]
};
// END

assert.assertJsonEquals(expected, result);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy