• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

Downloading Viewable File

Hello All.

I am developing a Product CD in HTML (viewable only in MS Internet Explorer because of the plug-in I must use).

The situation is that I have set up a page where the user can click on a button and view an Autocad Drawing on the HTML page (thanks to the "Volo View" plug-in by Autodesk).  Below the drawing I would like to have another button labelled "Download This Detail." - meaning that the user could then save the detail that is displayed in front of them to their hard drive.

My question is, how do I accomplish this?  When I use a standard <A HREF="drawing.dwg">Download</A> tag the drawing is simply displayed again in the full browser window (I want the "save file as..." dialog box to come up).

I'm sure that this is possible, but I just don't know how.

Please help
0
tmaga
Asked:
tmaga
  • 2
  • 2
  • 2
1 Solution
 
BrigidCommented:
If the file is supported by a browser, using <a href="drawing.dwg">Download</a> will simply show the item in the browser. If the broswer doesn't support the file type, like zip files, it will attempt to deal with it by opening a "Open/Save" Dialog box.

There are a few ways to handle this.
1) Make the drawing a zip file (or other unsupported file tye) and link the anchor tag to it. This may not be plausible, especially if these drawings are made on-the-fly.
2) Make the link you already have, but instruct the user to "right click" on the link and choose "Save Target As" in order to save the file to their hard drive.
3) Set up an ftp area on your server (if you can), and place the drawings in the ftp area so they may be downloaded. Then use an anchor to link to them like: <a href="ftp://www.mysite.com/drawing.dwg">Download this!</a>

I think the best option is number two, but that's just me.

Good luck!
0
 
tmagaAuthor Commented:
Thank you for your comments.  I would like to get additional clarification however.

1. Turning all these drawings (there are +/- 2000 of them) into zip format as well as having them in dwg format, would consume WAY to much space on the single CD.

2(a). Is there no more "attractive" way of accomplishing this?  I was hoping to make this truly idiot-proof ("whadda ya mean, the mouse has more than one button?" - true comment from an associate).

2(b). I was hoping to make the link an actual button (like the following code snippet):  Your right-click suggestion will not work with a button.  Is there an equivalent to the right-click when using a button?

<FORM>
 <INPUT type="button"
    value="Download Detail"
    onClick="some magic function that will make this work">
</FORM>

3. As you guessed with your suggestion #3, there will be no server system available.  All that we can assume is that the host computer has MS IE installed (no outside connections, etc.).
0
 
mark2150Commented:
Use the Autocad Whip viewer that uses .DWF files instead of .DWG files. You'll still have 2x the number of files but you view the .DWF and download the .DWG.

Your browser simply cannot "know" in advance that this <A HREF...> means to SHOW and this other <A HREF...> means to download when BOTH files have the same extension.

PKZIP is a very efficient way to store .DWG files. They compress pretty well. Although you'll have 2x the files on the CD, the .ZIP's will take less space than the original .DWG's.

In either case the file conversion can be automated with the help of a little BASIC code and a batch or two.

For example, you can easily write a piece of BASIC that, given a list of .DWG files (from a DOS DIR command...), drives AutoCad and makes it load the .DWG, run the DWFOUT command, and repeat for each one.

Writing a similar routine to use the DOS version of PKZIP to create one zip file for each .DWG would also not be hard.

M
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
tmagaAuthor Commented:
Thanks for your comment.

The Autodesk Whip! plug-in is used to view DWG or DXF files with Netscape Navigator.  I'm using the equivalent Autodesk plug-in called Volo View (it's for MS Internet Explorer).  The Volo View plug-in will let me do several things that the Whip! plug-in won't).

In any case, I won't need to have duplicate files on the CD because the plug-in will display the DWG files fine.

So, in answer to my original question, there is no "idiot-proof" way of having a button for the user to push that will download the displayed drawing?

Please let me know.
0
 
mark2150Commented:
Nope. The HTML syntax for "download" is the same as "Show" If the system understands the .DWG extension and can find a plug in for it, then the file is handed off to the plugin for display. If the system *doesn't* understand the extension, THEN it asks "what to do?" with the file, one option is "Download". Since the file extension is what is driving this behaviour, the ONLY choice is to have TWO extensions available. One to show, one to download. Since you're locked into .DWG for SHOW, you're going to have to come up with something else (.ZIP?) for download.

M
0
 
BrigidCommented:
For reference, the answer to the problem was using file:// instead of http:// in the anchor tag.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now