Expand my Community achievements bar.

Does aem-upload work with external assets and not local files?

Avatar

Level 4

I am trying to use https://github.com/adobe/aem-upload for my project. I was able to test separately from local by keeping as asset in local folder and uploading successfully into cloud aem. But next level, I am trying to pass url instead of local files and run from AppBuilder action. 

 

I realize, this is working only with local files. When I try like 

const targetUrl = 'http://localhost:4502/content/dam/target';

// list of all local files that will be uploaded.
const uploadFiles = [
    {
        fileName: 'file1.jpg', // name of the file as it will appear in AEM
        fileSize: 1024, // total size, in bytes, of the file
        filePath: 'https://www.google.com/publicurl/file1.jpg'
    },
    {
        fileName: 'file2.jpg',
        fileSize: 512,
        filePath: 'https://www.google.com/publicurl/file2.jpg'
    }
];

const upload = new DirectBinary.DirectBinaryUpload();
const options = new DirectBinary.DirectBinaryUploadOptions()
    .withUrl(targetUrl)
    .withUploadFiles(uploadFiles);

pass an absolute url to filePath, this is not working. 

 

Next documentation reads to use local files, OR download the asset as blob and ignore filePath. Is there a working example where you download asset into blob and call withUploadFiles() ?

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies