We have a DelphiXE program that creates HTML documents using TWebBrowser and stores only their bodies in sql database.
Now we want to add images into the documents. When we add an image then in src attribute we have
src="file:///D:/Projects/Test/IMAGES/img_1.GIF"
D:/Projects/Test is the location of the program and of the HTML file.
We want to have relative paths in src attribute, so when we change the src attribute
s:=elem.outerHTML;
s:='<IMG border=0 hspace=0 alt="pic 2" src="./IMAGES/955_2.GIF">';
// or s:='<IMG border=0 hspace=0 alt="pic 2" src="IMAGES/955_2.GIF">';
elem.outerHTML:=S
then src attribute does not change, it remains the same
src="file:///D:/Projects/Test/images/Img_1.GIF"
We set the base dir in the HTML file with Notepad to
<BASE href="D:\Projects\Test\">
with no success.
How we can change src attribute to have there relative paths?