Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wangxusq
Contributor III
Contributor III

How to add the picture in the Mashup

Hi all,

I created a mashup based the basic mashup template.Then I put a picture D:\QlikShare\StaticContent\Extensions\DemoTest(This is my mashup extension path).

Then I used the code  <img src="index.jpg"  alt="welcome" /> in my HTML.

But when I review the page on the server, the picture not show.

If I double-click the HTML file in the folder ,the picture can display.

So what's wrong?Please help. How to use the picture in the mashup?

22 Replies
wangxusq
Contributor III
Contributor III
Author

Also tried, still failed.Now See below:

1.png

Can you try it on your QSserver?  Thanks

ErikWetterberg

Hi,

If you reference it with <img src="index.jpg" it should be in the same directory as your html file, the main mashup directory. Make sure you include it in the zip file that you import on the server and it should work fine.

Note that this is the web server path, so there should be no D:, C: etc in the path.

Erik Wetterberg

wangxusq
Contributor III
Contributor III
Author

Hi,

Thanks for your response.

Yes, it is in the same directory,the main mashup directory. I copy the picture file into the directory, this true?

Of course ,I also test the path like this:https://XXX/extensions/DemoTest/index.jpg.

But still failed. what's wrong?

Thanks.

ErikWetterberg

Hi,

There are two ways to define the path, relative or absolute. Just giving the filename, "xxxx.jpg" means that it should be in the same directory as the html file where the link is, so a relative path. That's easier in most cases. If you use an absolute path the path depends on if you use a virtual proxy (should be in the path), the name of the qext file (also in the path, after /extensions/).

Have you chacked the browser console for errors? Can you open the image if you just type in the path to the image in the browser??

Erik Wetterberg

wangxusq
Contributor III
Contributor III
Author

Hi,

I used a  relative path and  the picture is  in the same directory as the html file where the link is .

The message is as belows:

1.png

Chanty4u
MVP
MVP

the error says image not found

wangxusq
Contributor III
Contributor III
Author

But the path is right.

See they are the same folder :

2.png

ErikWetterberg

And you have put the file 'index.jpg' in the extension zip file and imported it through the QMC? I don't think copying it straight into the directory on disk will work.

Erik Wetterberg

wangxusq
Contributor III
Contributor III
Author

So you mean I must export zip file first and then imported the zip  through the QMC?

ErikWetterberg

You might be able to add it through dev-hub but if not adding it to the extension zip file would do it. There is probably also a rest call you could make.

Erik Wetterberg