Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!

Online:Image Upload Issue

Avatar

Level 7

Hi,

I am getting below error while uploading images. Need quick assistance.

1723532_pastedImage_0.png

Thanks,

Anita

6 Replies

Avatar

Level 8

Hi,

Make sure both image and html are in the same location.

The image name has to be same inside the html as well.

Regards,

Venu

Avatar

Level 7

Hey Venu,

Thank you for your response but I am just uploading image manually using: Resources->Online->Public Resources option.

Regards,

Anita

Avatar

Level 8

Hi anitap82640902​,

I tested in my instance and it is working as expected.

There are multiple ways to upload an image.

Please check this thread and it will help you How to Upload a file using Webapp Adobe Campaign?

Regards,

Venu

Avatar

Level 7

Hi Venu,

Thank you for your response.

I will try this.

Regards,

Anita

Avatar

Level 7

Hi Venu,

I tried using the below code snippet to upload the image but it does not read the image path and gives the error:

var file = new File("<File Path on my local\image.jpg>"); 

if(!file.exists) 

     logError ("File '" + file.fullName + "' does not exist."); 

var extension = /[^.]+$/.exec(file.name); 

var md5 = HMACStr(file.name,"UTF-8","MD5"); 

 

----> Gives error, File does not exist.

if (!file.copyTo("path_to_adobe\\Adobe Campaign v6\\var\\res\\bootcamp\\" + md5 + "." + extension)) 

     logError ("File '" + file.fullName + "' was not copied"); 

var xmlString = '<fileRes alt="" codepage="0" height="0" name="owl.jpg" nature=""  publish="0" storageType="5" useMd5AsFilename="1" userContentType="0" version=""  width="0" xtkschema="xtk:fileRes"/>' 

var fileRes = xtk.fileRes.create( new XML(xmlString)); 

fileRes.contentType="image/jpeg"; 

fileRes.label = "some_label" 

fileRes.md5 = md5; 

fileRes.fileName = "path_to_adobe\\Adobe\\Adobe Campaign v6\\bin\\..\\var\\res\\bootcamp\\" + md5 + "." + extension; 

fileRes.originalName = "path_to_file\\Downloads\\mont.jpg"; 

fileRes.save();

Can you please assist on this?

Regards,

Anita