473,857 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

InterPage Linking Problem in .mht file

2 New Member
Hello All,


I have created a .mht file in following format.

1. The .mht file contains following htmls.
a. MHTLinkingProbl em.html
b. Left.html
c. Right.html
d. Start.html
e. Plus.gif

2. The MHTLinkingProbl em.html is the main html which is divided in 2 frames.
3. The Start.html dummy html to display the start of the page
4. The Right.html contains :-
a. An image with a source attribute pointing to the content-id of the image embedded in the .mht file.
Code: - <img src="cid:plus.g if" alt="plus.gif">

b. And a anchor tag with a name attribute.
Code: - <a name="LinkName" >

5. The Left.html contains two links to the Right.html. :-
a. <a href="cid:Right .html" target="Data">L inkWithoutFragm entRefURL</a>
b. <a href="cid:Right .html#LinkName" target="Data">L inkWithFragment RefURL</a>


THE PROBLEM:-

The link shown in 5.b is not working. That is I am not able to refer a particular fragment of the html file using .mht. This is because the .mht resolve this URL in following format:-

cid:Right.html# LinkName

Now there is no content-id naming cid:Right.html# LinkName so it returns a error Page Cannot be displayed.


QUESTION:-

1. How to use the Relative Reference URL in the href attribute of the anchor tag so that it refers to a fragment(anchor tag with name attribute) of ANOTHER html in the same .mht file?

Copy the code and save it as <Test>.mht file.
CODE :-

Expand|Select|Wrap|Line Numbers
  1. From: Regression
  2. To: Regression-User
  3. Subject: Regression
  4. Message-ID: Regression.html
  5. Mime-Version: 1.0
  6. Content-Type: multipart/related; boundary="----------1234567890------00-----";
  7. type="text/html"
  8.  
  9. ------------1234567890------00-----
  10. Content-Type: text/html; charset="US-ASCII"    
  11.  
  12. <html>
  13.     <head>    
  14.         <title>MHTLinkingProblem</title>
  15.     </head>
  16.     <frameset cols="350,*">
  17.         <frame src="cid:Left.html" name="Navigation" scrolling="yes" noresize/>
  18.         <frame src="cid:Start.html" name="Data" scrolling="yes" noresize/>
  19.     <noframes>
  20.         <h1>Sorry, this browser does not support frames.</h1>
  21.     </noframes>
  22.     </frameset>
  23. </html>
  24.  
  25. ------------1234567890------00-----
  26. Content-Location: cid:Left.html
  27. Content-ID: Left.html
  28. Content-Type: text/html            
  29.  
  30. <html>
  31.     <head>
  32.         <title>Right</title>
  33.     </head>
  34.     <body>    
  35.         <ul>
  36.             <li><a href="cid:Right.html" target="Data">LinkWithoutFragmentRefURL</a></li>
  37.             <li><a href="cid:Right.html#LinkName" target="Data">LinkWithFragmentRefURL</a></li>
  38.         </ul>
  39.     </body>
  40. </html>
  41.  
  42. ------------1234567890------00-----
  43. Content-Location: cid:Right.html
  44. Content-ID: Right.html
  45. Content-Type: text/html            
  46.  
  47. <html>
  48.     <head>
  49.         <title>Left</title>
  50.     </head>
  51.     <body>
  52.         This is a Right Hand Side of Page.<br/>        
  53.         <br/>                
  54.         <IMG SRC="cid:plus.gif" ALT="plus.gif"></body>
  55.  
  56.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  57.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  58.  
  59.         <a name="LinkName"><b>This the Location where LinkWithFragmentRefURL should refer to.</b></a>                    
  60. </body>
  61. </html>
  62.  
  63. ------------1234567890------00-----
  64. Content-Location: cid:Start.html
  65. Content-ID: Start.html
  66. Content-Type: text/html            
  67.  
  68. <html>
  69.     <head>
  70.         <title>Left</title>
  71.     </head>
  72.     <body>
  73.         This is a Starting Page.
  74.     </body>
  75. </html>
  76.  
  77. ------------1234567890------00-----
  78. Content-Type: image/gif
  79. Content-ID: plus.gif
  80. Content-Transfer-Encoding: base64
  81. Content-Disposition: inline; filename="plus.gif"
  82.  
  83.  
  84. R0lGODlhEAAQAKIAAMDAwICAgACAgAAA/wAAAP///wAAAAAAACH5BAUUAAUALAAAAAAQABAAAANC
  85. WLpFxHC5MV5Uk1LLstZcIwBfyRHDWH4WmpLr1mhq7LhUDRJCMNMwx6iH+QiEgKRDAholAcvO5hmN
  86. oHjVSyOr7SoSADs=
  87.  
  88. ------------1234567890------00-------
Dec 24 '08 #1
4 8075
numberwhun
3,509 Recognized Expert Moderator Specialist
I am not trying to feign ignorance, but what is a ".mht" file? Is this something specific to a program? If so, is this a problem with that program or with HTML itself?

I ask as this is an HTML forum, not a forum for a specific program and I would have to move this thread to the miscellaneous forum.

Regards,

Jeff
Dec 27 '08 #2
eWish
971 Recognized Expert Contributor
@Jeff - .mht is a Microsoft thing.

--Kevin
Dec 28 '08 #3
drhowarddrfine
7,435 Recognized Expert Expert
Yes, it's an archiving file. Firefox has an extension, and 'nix has programs, that can read/write these so I find it useful to save pages that contain graphics and running javascript.
Dec 28 '08 #4
naveenmurthy
2 New Member
Hello all,

Thanks everyone for the reply.

I am checking the replies today.

.mht helps bundle multiple files such as hmtl/CSS/Images/JavaScript to one single file, exactly as the "Kevin" above has posted.

The problem is at its core is an html relative linking within pages.

1.For example, I have a page Left.html has a relative hyper linking within the some other page Right.html#Link Name.All these linking are working as an individual html files but when I combine all the html files to single .mht file the links with

Expand|Select|Wrap|Line Numbers
  1. <a href="cid:Right.html#LinkName" target="Data">LinkWithFragmentRefURL</a> 
Show the error on the page. But the link

Expand|Select|Wrap|Line Numbers
  1. <a href="cid:Right.html" target="Data">LinkWithoutFragmentRefURL</a> 
Works fine.


2.From the .mht point of view, if I Try navigating to the 2nd link from another page (Right.html), I get an error. But navigating to the 2nd link from the same page (Left.html) is no problem i.e. checking on the link form the same page.

Regards
Naveen Murthy

Copy pase the code and save it as <Test.mht>

Code:-

Expand|Select|Wrap|Line Numbers
  1. From: Regression
  2. To: Regression-User
  3. Subject: Regression
  4. Message-ID: Regression.html
  5. Mime-Version: 1.0
  6. AbsoluteURI: "thismessage:/"
  7. Content-Type: multipart/related; boundary="----------1234567890------00-----";
  8. type="text/html"
  9.  
  10. ------------1234567890------00-----
  11. Content-Type: text/html; charset="US-ASCII"    
  12.  
  13. <html>
  14.     <head>    
  15.         <title>MHTLinkingProblem</title>
  16.     </head>
  17.     <frameset cols="350,*">
  18.         <frame src="file://c:/Left.html" name="Navigation" scrolling="yes" noresize/>
  19.         <frame src="cid:Start.html" name="Data" scrolling="yes" noresize/>
  20.     <noframes>
  21.         <h1>Sorry, this browser does not support frames.</h1>
  22.     </noframes>
  23.     </frameset>
  24. </html>
  25.  
  26. ------------1234567890------00-----
  27. Content-Location: file://c:/Left.html
  28. <!-- Content-ID: Left.html -->
  29. Content-Type:text/html;
  30.  
  31.  
  32. <html>
  33.     <head>
  34.         <title>Right</title>
  35.     </head>
  36.     <body>    
  37.         <ul>
  38.             <li><a href="cid:Right" target="Data">LinkWithoutFragmentRefURL</a></li>            
  39.             <li><a href="cid:Right#LinkName" target="Data">LinkWithFragmentRefURL</a></li> <!-- mhtml:file://C:\Documents%20and%20Settings\nam1cob\Desktop\MHTLinkingProblem.mht! -->
  40.  
  41.         </ul>
  42.     </body>
  43. </html>
  44.  
  45. ------------1234567890------00-----
  46. Content-Location: file://c:/Right.html
  47. Content-ID: Right
  48. Content-Type:  text/html            
  49.  
  50. <html>
  51.     <head>
  52.         <title>Left</title>
  53.     </head>
  54.     <body>
  55.         This is a Right Hand Side of Page.<br/>        
  56.         <br/>                
  57.         <IMG SRC="cid:plus.gif" ALT="plus.gif"></body>
  58.         <!-- Please dont delete these br. These are required. -->
  59.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  60.         <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  61.  
  62.  
  63.  
  64.         <a name="LinkName"><b>This the Location where LinkWithFragmentRefURL should refer to.</b></a>                        
  65.  
  66.     </body>
  67. </html>
  68.  
  69. ------------1234567890------00-----
  70. Content-Location: cid:Start.html
  71. Content-ID: Start.html
  72. Content-Type: text/html            
  73.  
  74. <html>
  75.     <head>
  76.         <title>Left</title>
  77.     </head>
  78.     <body>
  79.         This is a Starting Page.
  80.     </body>
  81. </html>
  82.  
  83. ------------1234567890------00-----
  84. Content-Type: image/gif
  85. Content-ID: plus.gif
  86. Content-Transfer-Encoding: base64
  87. Content-Disposition: inline; filename="plus.gif"
  88.  
  89.  
  90. R0lGODlhEAAQAKIAAMDAwICAgACAgAAA/wAAAP///wAAAAAAACH5BAUUAAUALAAAAAAQABAAAANC
  91. WLpFxHC5MV5Uk1LLstZcIwBfyRHDWH4WmpLr1mhq7LhUDRJCMNMwx6iH+QiEgKRDAholAcvO5hmN
  92. oHjVSyOr7SoSADs=
  93.  
  94. ------------1234567890------00-------
Dec 29 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2368
by: Dibyendu Roy | last post by:
Hi All, I build an object called "dblorcle" to connect to oracle database in Sun solaris box. This is built linking with various oracle ".a" (archived, for static linking) files come with standard oracle library. I use the following command while linking: ld -L(oracle lib path) -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lcommon -lgeneric -lmm -lnlsrtl3 -lcore4 For each element starting with -l has...
7
5132
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting normal functions in header files results in multiple definition errors even when include guards are used. -- STH Hatton's Law: "There is only One inviolable Law" KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com Mozilla:...
20
3248
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external references to functions and objects not defined in the current translation. All such translator output is collected into a program image which contains information needed for execution in its execution environment." What I'm wondering is what exactly...
1
6104
by: Venky | last post by:
I'm compiling a C program that is using Interbase 6.0 APIS. Getting the following errors at the time of linking. Linking test.exe: Linker Warning: No module definition file specified: using defaults Linker Error: Undefined symbol isc_detach_database in module TEST.C ..... ..... If I set the option not to generate the underscore (function prefixed with "_") I get the following errors. Interbase 6.0 APIs resolved
7
6561
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with LIBCMT(D).DLL. (My requirement is that we can't link with MSVCRT(D).LIB.) Below are steps I've followed, and the resulting problems 1. Using the New Project wizard, generate a Visual C++ .NET Class Library project (call it "Doomed") and a VC++...
6
6590
by: Rudy Ray Moore | last post by:
I work with a multi-project workspace. One project (the "startup" project) has a "Configuration Type" of "Application (.exe)". The other 40 projects have a "Configuration Type" of "Static Library (.lib)". My question: Should the linker incrementally link when I make a change to one of the ..cpps in one of my .lib projects? For VC6 the answer is yes.
0
3991
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
2
2460
by: Jim Johnson | last post by:
C++ linking works by using Linker to combine object files into single exe file. Does each .cpp file compile to a single .obj file? If the .cpp code called functions in some library (.lib) does the Linker will extract the required .obj object file from the library and link together with other .obj file to form a EXE? So the EXE file can be think of a code file that merged all the .cpp
1
2333
by: agarwasa2008 | last post by:
Hi, I have a perfect file called "Products.xls" that I link to my MS Access 2003 database and everytthing looks good in that file. When I view the same file after linking in my database the data values of records in "tblProducts" are incorrect. For example the tblProducts has a field called "PackageSize" as listed below. THe problem is that it displays the text correctly but if the field has numbers only it messes it up. I have set...
0
9923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10808
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10394
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9549
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7940
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5774
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4191
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.