Finding a file in db by name - how to?

Started by ubacher, June 18, 2017, 10:55:24 AM

Previous topic - Next topic

ubacher

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?

Mario

Check out the documentation for /search/filename in the IMatch WebServices Documentation. All you need in just one endpoint.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

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?

sinus

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
Best wishes from Switzerland! :-)
Markus

Mario

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));
});                   
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook