Displaying data in the "attachments" table

Open discussion about the Alloy Navigator 5 Web Portals

Displaying data in the "attachments" table

Postby dphizler on Wed Dec 31, 2008 2:37 pm

Now I have a new question.

I was looking at the database just now and well I wanted to try and display the data contained in the "attachments" table. Basically the content of files is stored in the database table in the "data" column. The data is somehow encoded. My problem is that I have no idea what method is used to encode the data. I've tried to decode it in Hexadecimal and base 64 but that hasn't given me what I want.

If anyone can help me, it would be greatly appreciated.

Thanks,

Phil
dphizler
Junior
 
Posts: 6
Joined: Tue Nov 25, 2008 11:26 pm
Location: Montreal, Quebec, Canada

Re: Displaying data in the "attachments" table

Postby eliaslynch on Mon Jan 05, 2009 3:43 pm

They're stored in what's called a BLOB or Binary Large Object. See if this link might help you - http://support.microsoft.com/kb/173308
--------
Elias
User avatar
eliaslynch
Senior
 
Posts: 212
Joined: Wed Jul 09, 2008 7:03 pm

Re: Displaying data in the "attachments" table

Postby dphizler on Tue Jan 06, 2009 10:38 am

Thanks for the reply.

Yeah, I know. The datatype is the "image" datatype. You can store any type of file in that. I just have no idea how to display that file afterwards. I know it's encoded in base64 (or something like that) but after I've decoded it. I get some weird stuff and I have no idea how to go from there. I've tried everything that I can think of.

Your link is actually very help.

A new problem has revealed itself. For some odd reason files uploaded from the web portal and files attached through Alloy Navigator aren't stored the same way in the database. There seems to be another layer of encryption when the file is attached through Alloy Navigator. That certainly doesn't help.
dphizler
Junior
 
Posts: 6
Joined: Tue Nov 25, 2008 11:26 pm
Location: Montreal, Quebec, Canada

Re: Displaying data in the "attachments" table

Postby dphizler on Thu Jan 08, 2009 11:57 am

I have all kinds of questions, but here is my latest question:

In the database table Attachments, there is a field called "Data".

So I attached the same file using the Web Portal and Alloy Navigator and the "Data" field ended up containing different data. So something different happens when you attach a file using Alloy Navigator and I'm currently a little lost.

Web Portal upload: 74657374696E67
Alloy Navigator upload: 21485A4C0700000000F8FFF17EBFAF98

The text contained in the file is "testing"

Using this website, the Web Portal upload is clearly encoded in Hexadecimal: http://www.string-functions.com/hex-string.aspx

So the real question is: What's different between when you upload a file using the Web Portal and when you use Alloy Navigator?

Thanks for your input
dphizler
Junior
 
Posts: 6
Joined: Tue Nov 25, 2008 11:26 pm
Location: Montreal, Quebec, Canada

Re: Displaying data in the "attachments" table

Postby eliaslynch on Tue Jan 13, 2009 2:29 pm

dphizler wrote:So the real question is: What's different between when you upload a file using the Web Portal and when you use Alloy Navigator?


This is a bit beyond my skills so maybe someone else can chime in, but I wonder if it has something to do with compression. Maybe '74657374696E67' is simply not being compressed?
--------
Elias
User avatar
eliaslynch
Senior
 
Posts: 212
Joined: Wed Jul 09, 2008 7:03 pm

Re: Displaying data in the "attachments" table

Postby pille on Mon Jan 19, 2009 5:01 pm

Actually Elias is right. The Web Portal does not compress attachments, but the Main Console does. This is why the data looks differently.
Contact Technical Services directly:
support@alloy-software.com
http://support.alloy-software.com

Paul Ille
Alloy Software
Maximize your IT Universe
Follow us on Twitter: http://twitter.com/alloysoftware
Image
User avatar
pille
Alloy Software
 
Posts: 473
Joined: Thu Aug 11, 2005 3:11 pm
Location: New Jersey, USA

Re: Displaying data in the "attachments" table

Postby eliaslynch on Wed Jan 21, 2009 7:48 pm

Oh my look at that :) I was right hehe

Woohoo! :shock:
--------
Elias
User avatar
eliaslynch
Senior
 
Posts: 212
Joined: Wed Jul 09, 2008 7:03 pm

Re: Displaying data in the "attachments" table

Postby efrenlugo on Fri Jun 17, 2011 12:40 am

It seems to be compressed, how could be descompressed? the header shows !HZL
efrenlugo
Junior
 
Posts: 2
Joined: Fri Jun 17, 2011 12:37 am

Re: Displaying data in the "attachments" table

Postby efrenlugo on Fri Jun 17, 2011 6:02 am

It's possible to extract all the attachments from the database by using asp? I can extract the contents from the fields but this files are compressend in something couldn't be read.
efrenlugo
Junior
 
Posts: 2
Joined: Fri Jun 17, 2011 12:37 am

Re: Displaying data in the "attachments" table

Postby mike_ge on Tue May 29, 2012 10:58 am

Hello to all,

I do a little update on this post, because as I can see, I wasn't the only one who got stuck by the compression of the attachments in the database of Alloy. After few hours I found a solution that can work using Windows or Linux.

As efrenlugo said, all the attachments start with a !HZL header, that can lead to a LZH algorithm compression. In fact it is really not far from the truth. The compression used by Alloy is the HNF algorithm, that more and less the same as the LZH (LH1) but with a different parameter. More information can be found here.

The tool to uncompress the datas is HNFTools Full and can be downloaded here.

In the zip file you will find a linux and a win32 directory, and in both of them you will have to use the executable/binary called hnf2fvt.

You will have to use it on a file, it means that you must extract all the attachment from your database and save them as file, and use the executable on the compressed extracted file. To retrieve the original filename, use the File_Name row from the Attachments table of Alloy.

Hoping that gonna help few of you and please excuse my english, it isn't my native language.

Mike.
mike_ge
Newbie
 
Posts: 1
Joined: Tue May 29, 2012 9:26 am

Re: Displaying data in the "attachments" table

Postby janstonselig on Fri Jun 29, 2012 1:35 pm

Nice! :)
User avatar
janstonselig
Senior
 
Posts: 174
Joined: Thu Aug 30, 2007 1:12 pm


Return to Alloy Navigator 5 Web Portal Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron