Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi, I have a use case where data files are generated periodically, and I need to ingest these data files to Thingworx platform and stored. Is there a way I can monitor the directory where data files are, and trigger Thingworx to process (parse and store to database) the file when a new file is saved to the directory? thanks a lot!
There's no events for new files, but you can poll for directory changes with a Timer Thing.
This will be my last resolution, if no events, thank you.
Ping, i suppose the most basic thing here to begin with is to have an event which must fire to notify automatically whenever there's a new file added to the directory. Now if this directory is not part of the thingworx repository the event, that should fire to notify change/update, should fire on the OS's file system.
If you are working on Windows you can check the IO.FileSystemWatcher class which can be invoked from powershell(includes the sample) and then you can do a HTTP POST to ThingWorx with the file for processing
If you are on Linux it'll be inotify
hope this helps.
Thank you for your recommendation. I thought of this as well, but if I have multiple folders to monitor, creating an additional application(s) to generate this event might not be a good choice, in terms of maintainability and scalability.