Question

I've got a problem with one of the pages within a website. This page will serve images according to the selection a user makes like PDF, GIF, DWG and.. DXF I understand why PDF and GIF will attempt to open in a browser, but the DXF files will (using firefox and chrome) try to open inside the browser window too - unsuccesfully, but attempting. How can I get my page to serve the files as a downloadable resource and not inside the browser? This is a problem with DXF (although, and if possible, I'd like the same behavior with the PDF).

Already added the DXF filetype to the metabase in order to allow access to this type of file.

Was it helpful?

Solution

I experience this kind of issue all too often. You'll notice that if the user doesn't have Autocad or a DXF viewer installed then it will attempt to download the file: so it's a 'feature' of DXF viewers that they will try to open the file in a browser. There are a couple of things you can try:

1) Tell the user to 'right-click and download' on the link to the file (or link to the page that serves the file) [they rarely go for this though and will still complain that it's the website's fault]

2) Try sending the file as an attachment. This is probably what you want :)

http://support.microsoft.com/kb/260519

See also a bug in IE4.01 (as if anyone still uses it!): http://support.microsoft.com/kb/182315/

Hope that helps!

(edit: I can see the solution is for ASP, which makes sense to me, but might not to you. You'd do a line like: Response.Headers.Add("content-disposition", "attachment; filename=hello.dxf");)

OTHER TIPS

So there is a page that serves the file and not a direct link to the file itself? Are you sending the right content-type for these files?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top