在我们做人脸识别,门口动静提醒等等的时候我们需要相关的文件存储到响应的目录里面去,利用以往的节点往往需要拷贝复杂的流程,文件夹和文件名称极易出现错误,所以有了下面的节点。
按照日期把文件存储起来,目录你格式如下:xxxx-xx-xx,例如我今天就是:2019-06-14, 然后文件名字按照:xxxx-xx-xx-xx-xx-xx,例如今天:2019-06-14-20-12-22-(这两个是随机数,防止同1s文件被覆盖),然后后面添加对应的文件格式。
red-contrib-time-photo-files
节点信息:
[{"id":"d7878f8a.ae593","type":"tab","label":"流程1","disabled":false,"info":""},{"id":"76580b44.799384","type":"gaode-direction","z":"d7878f8a.ae593","server":"e8313e7d.4f79e","longitude_source":"116.481028","latitude_source":"39.989643","longitude_direction":"80.434446","latitude_direction":"39.989643","city":"","s1":false,"s2":false,"s3":false,"s4":true,"x":449,"y":1175,"wires":[[]]},{"id":"185a06cf.ca6569","type":"inject","z":"d7878f8a.ae593","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":157,"y":1056,"wires":[["76580b44.799384"]]},{"id":"acc08a9d.be1eb8","type":"inject","z":"d7878f8a.ae593","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":497,"y":217,"wires":[["d870db1b.e41238"]]},{"id":"8e2e69c9.a38b88","type":"debug","z":"d7878f8a.ae593","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1125,"y":202,"wires":[]},{"id":"d870db1b.e41238","type":"www-request","z":"d7878f8a.ae593","name":"大方摄像机获取图片","method":"GET","ret":"bin","url":"http://192.168.123.166/cgi-bin/currentpic.cgi","follow-redirects":false,"tls":"","x":761,"y":336,"wires":[["a58a02aa.3a542"]]},{"id":"a58a02aa.3a542","type":"time-photo-files","z":"d7878f8a.ae593","name":"xxx","dirname":"/opt/data","fileType":"jpg","appendNewline":false,"createDir":true,"clear":false,"overwriteFile":"true","encoding":"none","x":941,"y":343,"wires":[["8e2e69c9.a38b88"]]},{"id":"e8313e7d.4f79e","type":"gaode-server","z":"","name":"默认高德key","gaodeKey":"e6296643e3c1bf64508f685c635f1fab"}]