This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Direct URL Links and Shortened URLs

Former Member
Former Member
1) Is there a way to create a direct link to a document?  I found that changing "show" to "open" in this URL generated from "Create or Get Shortcut" context menu works, but is there an option to do this without manually editing the URL every time?

From [m-files://show/F21C8443-EEB3-442F-AA15-1000000000/0-20513?object=00000000]
to [m-files://open/F21C8443-EEB3-442F-AA15-1000000000/0-20513?object=00000000]

2) I assume that there is not a shortened version of this URL built into M-Files and that a UI Extensibility would be required to add a context-menu item that shortened the URL.  Am I correct in that assumption?

Many thanx!
  • The format of the link is quite straight-forward, so you could quite easily generate it if you know some information about the object you're trying to view:


    m-files://{verb}/{vault-guid}/{object-type-id}-{object-id}[?object={version-guid}]


    So, provided you know the various bits above, you can generate the link yourself.

    This is the only handler format that I'm aware of. If you wanted to shorten it then you'd incur an additional level of complexity:
    [list type=decimal]

    • The web browser would open and go to bit.ly and be provided with a redirect to the original address

    • The user's web browser MAY follow the link (as it's now a non-HTTP/HTTPS handler prefix, it may be subject to some security at this point), or it may prompt the user to open the link
    • [/list]


    You've also then taken a dependency upon both that external connectivity (what if their link goes down?) and upon the external URL shortening service.

    So, in that vein, I guess I would ask why you need to shorten the link?

    Craig.
  • Former Member
    Former Member
    Thank you for the informative reply!

    Knowing the format should make it easy to write a new UI menu item. Do you know the list of {verb}s that can be used?

    As for the shortened URL, I'd rather not use an internet service for many of the reasons you mentioned as well as the fact that many of my client PCs will not have full internet access.

    Our ERP system allows linking files (specifically drawing files in this case) to various objects (work orders, parts), but has a dB and software limitation on the length of the link (100 chars I believe). A shortened URL is a necessity for us if we're going to use M-Files for all our documents, so it looks like I'll have to program my own internal web service to accomplish this task.

    Thanx again for the info.
  • I don't have a list, but I believe the verbs derive from the MFilesURLType enum within the documentation:


    Member Value Description
    MFilesURLTypeEdit 3 Specifies an URL for performing the open-for-edit action for the target file.
    MFilesURLTypeOpen 1 Specifies an URL for performing the default open action for the target file.
    MFilesURLTypeShow 0 Specifies an URL for showing the object version. The URL does not open the target file.
    MFilesURLTypeShowMetadata 6 Specifies an URL for showing the metadata card for the target object.
    MFilesURLTypeView 2 Specifies an URL for performing the read-only open action for the target file.


    I've used view and show before, so I could take a wild punt at what others might work ;)

    That sounds like a crappy legacy limitation. 100 characters may be okay if you lose the version guid. But yes, I can see why you want to do that.

    Craig.