photools.com Community

IMatch Discussion Boards => IMatch Scripting and Apps => Topic started by: ubacher on June 18, 2017, 10:55:24 AM

Title: Finding a file in db by name - how to?
Post by: ubacher on June 18, 2017, 10:55:24 AM
How can I find/get a file from anywhere in the database if I have only a name?

Would I use folderScan?

Or do I have to read in all files and search through them?
Title: Re: Finding a file in db by name - how to?
Post by: Mario on June 18, 2017, 11:06:25 AM
Check out the documentation for /search/filename in the IMatch WebServices Documentation. All you need in just one endpoint.
Title: Re: Finding a file in db by name - how to?
Post by: ubacher on June 30, 2017, 07:01:50 PM
Tried to find an example for v1/search/filename but could not find one.
I don't trust myself to find out how to issue such a call.

Anyone got an example please?
Title: Re: Finding a file in db by name - how to?
Post by: sinus on June 30, 2017, 07:06:28 PM
Quote from: ubacher on June 30, 2017, 07:01:50 PM
Tried to find an example for v1/search/filename but could not find one.
I don't trust myself to find out how to issue such a call.

Anyone got an example please?

ubacher, would love to help you ...

but I am overhelmed at the moment with work and also overhelmed (still) with JS  :-[

But the day will come, when I have more time to lern all, ähm, not all, but something form this stuff.

You made great steps ahead, as far as I can read. Gratulations!  :D
Title: Re: Finding a file in db by name - how to?
Post by: Mario on June 30, 2017, 07:21:54 PM
Search entire database for 'beach'. Return id and filename:


IMWS.get('v1/search/filename',{
    scope: 'database',
    pattern: 'beach',
    fields: 'id,filename'
}).then(function(response) {
    console.log(JSON.stringify(response,null,2));
});