I’m having trouble with
the following code for images:
const options = {
displayName: fname,
filePath: '/Media/Pictures',
mediaType: mediatype,
mimeType: mimetype,
private: **false**
}
**try** {
**const** importedFile = **await** files.importFile(fullurl, options);
console.log("Imported file successfully:", importedFile);
**return** importedFile;
} **catch** (error) {
console.error(error);
// Handle the error
}
if mediatype is “IMAGE”, the file is imported to the root directory, ignoring the filePath option. However if the mediatype is '“DOCUMENT”, it works fine… This behavior started recently. It was working correctly for images, but not now.
Any thoughts?
Thanks,
Rocky Altimore