• BusiMum

    (@busimum)


    I need to add a link to an autocad file (.dwg) onto a page.

    AS this file format is not allowed by WP, how can I do this?

    Cheers

    Fiona

Viewing 10 replies - 1 through 10 (of 10 total)
  • if you just need to link to it, either compress it as a zip file (which I believe WP allows)

    Or, upload it outside of the WP uploader. So use ftp, or a file manager if your host offers one, and upload it that way to your uploads directory. Then you can link to it using the actual URL where you placed the file (http://domain.com/wp-content/uploads/whatev.dwg for example)

    If you plan to upload many of these files, it is also possible to extend the allowed mime types for uploads to include .dwg, probably not worth the effort for a single file tho….

    Thread Starter BusiMum

    (@busimum)

    Thanks Voodoo. I actually have heaps of these files to add to the site. How can I change the mime? I think that would be the easiest option.

    Cheers

    Fiona

    esmi

    (@esmi)

    Something like:

    function add_cad($mimes) {
    $mimes = array(
    		'dwg' => 'application/dwg',
    );
    return $mimes;
    }
    add_filter('upload_mimes','add_cad');

    should work.

    Thanks @esmi!! That was gonna take me a little bit to produce!! 🙂

    esmi

    (@esmi)

    Original code idea courtesy of Otto (of course) plus a bit of googling on dwg mime types. 🙂

    Thread Starter BusiMum

    (@busimum)

    Thank you to both of you. I will give that a try and let you know how it goes.

    Cheers!

    Thread Starter BusiMum

    (@busimum)

    workd great for dwg files, but now I am getting an error when trying to add pdf’s.

    Failed to upload due to an error (file type is not permitted for security reasons).

    Do pdf’s need to be specifically added to the same code above to make them work?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Shouldn’t. PDFs are blanket allowed. Try it, though. If it’s not that, it may be your server.

    Does this allow viewing of CAD files?? I know thats a stupid question!!
    But it’d be amaging if wordpress brought such functionalities. It’d become the best educational software ever!! Saw HubZero and its one awesome thing for scientific knowledge sharing!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    It’s not WP it’s your server (mostly).

    If your server can render CAD files, then WP can. Or you need a plugin that can render it for you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Adding an autocad .dwg file to a site’ is closed to new replies.