Read .MHT file using Coldfusion

168 views
Skip to first unread message

Ritika

unread,
Feb 19, 2014, 3:19:42 AM2/19/14
to col...@googlegroups.com
Hi,

I have a .mht file through an interface which I want to read through using Cold Fusion Code.

I have been trying to change it into excel to read it but it is not solving the purpose. I have been searching this over but haven't got any thing concrete for now.

Any pointers would be appreciated.

Thanks!

br...@bradwood.com

unread,
Feb 19, 2014, 3:38:12 AM2/19/14
to col...@googlegroups.com
Hi Ritika,
 
Is it this kind of file? http://en.wikipedia.org/wiki/MHTML
 
What are you wanting to do with the file once you "read" it?
 
Looking around the Internet, there appear to be several Java-based libraries you can probalby use:
 
Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sana Ullah

unread,
Feb 19, 2014, 3:39:29 AM2/19/14
to col...@googlegroups.com
Hi Ritika,

You can read file in coldfusion -> fileRead() function, I would suggest to have look ColdFusion file functions

Thanks


--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Warm Regards
Sana

Andrew Scott

unread,
Feb 19, 2014, 3:46:15 AM2/19/14
to col...@googlegroups.com
First it is not Cold Fusion unless you are using Cold Fusion 4 or lower, secondly as it is only an extension then it will be up to the browser to read it and do what it needs it to do.

As this format is an archive format, my recommendation would be to convert them on the fly to maybe PDF and server them this way.

But a Google search on how to convert an mht file to a pdf returns great articles.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



--

Ritika

unread,
Feb 20, 2014, 2:44:38 AM2/20/14
to col...@googlegroups.com
Hi Brad,

Yes its the MHTML file. 
It is a report wilt few rows and columns and I have to read the file to import that data in to the Database.

Thanks!

Andrew Scott

unread,
Feb 20, 2014, 2:55:06 AM2/20/14
to col...@googlegroups.com
Sounds like you need to write a parser to do this, have you got an example of the XML involved in it?

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



br...@bradwood.com

unread,
Feb 20, 2014, 9:21:06 AM2/20/14
to col...@googlegroups.com
MHTML isn't XML, it's a multi-part MIME file much like the raw source of an E-mail.  It has header, then content type boundaries.  That's how it stores an entire web page includes images and such in a single file.  There are Java libraries for parsing those files like the one I linked to that will unpack the HTML and images for you.
Reply all
Reply to author
Forward
0 new messages