htmldownloadchm

How to provide a download link for a dxf inside a chm


I have HTML code that compiles into a chm, and occasionally I want to include a link to directly download a file... for example a small binary drawing file (extension .qid in my app) used as sample data for a tutorial in the chm. I have been doing this just fine for little drawing files by just providing a link like this...

<a href="relativepath/some.qid" title="whatever">some text</a>

But my current problem is I have a little sample dxf that is to be used in this tutorial and when I provide a download link like this...

<a href="relativepath/some.dxf" title="whatever">some text</a>

...then I get a link ok, but when I click on it, it puts the dxf contents inline as text, rather than poppping up a download Save As dialog for some file at a path like mk:@MSITStore:wherever.dxf

Now I looked at HTML attribute doco and found a 'download' attribute which is meant to force the link to download, but it made no difference. I used this syntax...

<a href="relativepath/some.dxf" title="whatever" download>some text</a>

...which generated a chm with a link but ignored the attribute 'download'.

How can I force the href link to lead to a download dialog for a dxf file?


Solution

  • Please note CHM's are 20 years old. hh.exe is the HTMLHelp executable on Windows and associated with *.CHM files. It's just a shell that uses the HTML Help API and is really just hosting a browser window based on the old Internet Explorer in the HTMLHelp Viewer window. This is not based on Microsoft's browser EDGE!

    You know, the HTML (!) Attribute directs new browsers to download the linked resource rather than opening it. But - the download attribute is not supported by Microsoft Internet Explorer.

    I tested linking from a single local HTML file too. Other browsers like Firefox, Chrome and EDGE also open a link to a local *.DXF file always as text file.

    This also happens with embedded (compiled into a CHM file) *.dxf files.

    So, you'll need to create a link to a ZIP file like e.g. some.dxf.zipinstead.

    UPDATE:

    This is working when the *.DXF file is not embedded and stored on a server: Test it for your needs by using in the old manner

    <a href="http://www.help-info.de/files_download/Nikon_D90_Camera.dxf">test.dxf download</a>