473,382 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

InterPage Linking Problem in .mht file

Hello All,


I have created a .mht file in following format.

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

2. The MHTLinkingProblem.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.gif" 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">LinkWithoutFragmentRefURL</a>
b. <a href="cid:Right.html#LinkName" target="Data">LinkWithFragmentRefURL</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 8033
numberwhun
3,509 Expert Mod 2GB
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 Expert 512MB
@Jeff - .mht is a Microsoft thing.

--Kevin
Dec 28 '08 #3
drhowarddrfine
7,435 Expert 4TB
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
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#LinkName.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
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...
7
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...
20
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...
1
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...
7
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...
6
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...
0
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
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.