Files downoad

We have a number of dog files stored in templates.

Is it possible to download to a  specific location a job folder for instance only the files that are relative to that particular job.

It might be 10, 20 or all of the files.

Right now we have the files stored in different areas and they are duplicated which makes updating the files difficult.

I would like to be able to choose jobtype 1 or jobtype 2 etc and have only the files relative to their requirements.

Alternatively when selecting the job type only the files relative to that type are displayed for copy and paste.

New to M-files so any suggestions appreciated.

Evan

  • I would start by saying that M-Files' "view-based" approach can be a little awkward when you first start.  I think that's what you mean by "the files stored in different areas and they are duplicated".  Certainly they should not be duplicated, instead they should be the same object manifested in a number of pages.  If they are duplicated then I would suggest that you work with your reseller and end-users, as that certainly should not be the case.

    In general terms you should be able to retrieve the documents related to a particular job.  The way to do this would be to run a search (Searching using the COM API (m-files.com)) using conditions that reflect the objects you need (e.g. "all objects of type 'document' that have a 'job' property pointing at job 123, with a 'document type' property...").  Once you have the object information, you would then use the API to retrieve the files on each document, and download them to disk.

    The approach itself is not a huge number of steps, but the search API is a little overwhelming to start with, so take it slow and ask questions when you get stuck.  You may also want to see whether your local reseller has experience in this and is able to guide you (as it's much easier face-to-face than it is via a forum).

    Regards,

    Craig.

  • Craig,

    Thanks for your reply.

    What I need though is to take certain files from a list of 40 or more and place them in a folder on my network relative to the files required for each individual project or be able to copy and paste.

    Eg:

    Job 1 requires files 1, 2, 3, 4, 5 and 6

    Job 2 requires files 1, 3, 6, 10, 15 etc.

    Job 3 requires files 36, 37 and 39

    All the files would be in one location and either listed for copy and paste or listed for download from M-Files to the chosen folder on the network.

    Ultimately I would like a link in my M-Files templates location to be able to select a Job type and get the files relative to that job type only.

    I have only 8 job types.

    Evan

  • Hi Evan,

    The first step is to work out how you identify that "job 1 requires files 1, 2, 3, 4, 5, and 6".  You need some programmatic way of identifying all the documents associated with the job.  This will either be some sort of direct relationship (i.e. the job contains a property that points at the documents), some sort of indirect relationship (i.e. the documents contain a property that point at the job), or some sort of custom logic.  Either way: you need to understand that.

    Once you have that understanding you can design an approach using our API.  It supports pretty much any combination of the above that you may need.

    Honestly: I am not entirely sure that you need the API and/or a separate application for this.  I suspect that you may be able to access the content in-context within M-Files, negating the need for any separate copies.

    Have you spoken to your local reseller and asked them what they suggest?

    Regards,

    Craig.