iisnode无法访问网络文件路径中存在的文件 [英] iisnode not able to access file present in network file path
问题描述
我是iisnode的节点应用.我可以访问网络路径中存在的文件,但是当应用程序尝试访问文件时,它抱怨文件不存在".
I am node app through iisnode. I can access file present in network path but when the application tries to access the file, it complains ' File doesn't exist'.
我尝试添加IIS_IUSRS用户组以访问本地计算机中的iisnode www目录.我更改了我在网络路径上具有权限(R/W)的应用程序的用户名(来自应用程序池).重新启动我的机器.但是问题仍然存在.
I tried adding IIS_IUSRS user group to have access to iisnode www directory in my local machine. I changed the username(from application pool) of the application to which I have permission(R/W) on the network path. Restarted my machine. But still problem persist.
如果iisnode和网络文件路径之间存在问题,有人可以帮我吗?
Can someone help me if there is issue between iisnode and network file path.
const csv=require('csvtojson');
function fetchFile(){
sUsagefile ="\\\\abc\\xyz\\com.csv" .
csv().fromFile(sUsagefile));
console.log(sUsagefile);
}
Error: File does not exist. Check to make sure the file path to your csv is correct.
at C:\iisnode\www\node_modules\csvtojson\v2\Converter.js:81:37
at FSReqWrap.cb [as oncomplete] (fs.js:312:19)
推荐答案
我尝试使用iisnode访问UNC路径,并且运行良好. 您是否尝试直接授予IUSR和IIS Apppool \对网络路径\ abc \ xyz \ com.csv的读/写权限?
I tried to access UNC path with iisnode and it was working perfectly. Have you tried to grant IUSR and IIS Apppool\ read/writepermission for network path \abc\xyz\com.csv directly?
此外,您是否检查了当IIS停止工作时是否可以从文件资源管理器访问\ abc \ xyz \ com.csv.
Besides, have you checked whether \abc\xyz\com.csv can be accessed from file explorer when IIS stop working.
建议使用进程监视工具监视node.exe读取的路径.请从此处下载过程监视器: https://docs.microsoft.com/zh -cn/sysinternals/downloads/procmon ,然后添加一个类似路径包含com.csv"的过滤器.最后,我们将知道应用程序尝试读取的路径.
It is suggested to use process monitor tool to monitor what path is read by node.exe. Please download process monitor from here:https://docs.microsoft.com/zh-cn/sysinternals/downloads/procmon then add a filter like "Path contains com.csv". Finally we would know what path the application is trying to read.
这篇关于iisnode无法访问网络文件路径中存在的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!