Javascript setTimeOut函数混淆[复制](Javascript setTimeOut function confusion [duplicate])
这个问题在这里已经有了答案:
你好,你能解释一下setTimeOut(function,time)和setTimeOut(function(),time)之间的区别吗?
This question already has an answer here:
Hello can you explain me what is the difference between setTimeOut(function, time) and setTimeOut(function(), time)
原文:https://stackoverflow.com/questions/42495008
最满意答案
问题是您在路径中使用保留字符。 根据https://msdn.microsoft.com/en-us/library/aa365247在Windows上保留以下符号:
< (less than) > (greater than) : (colon) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk)
如果将路径格式更改为:它应该可以正常工作。
id_photo = mm + '-' + dd + '-' + yyyy + '-' + h + '_' + i + '_' + s; callback(null, id_photo + "-" + file.originalname);
The problem is that you are using reserved characters in your path. According to https://msdn.microsoft.com/en-us/library/aa365247 following symbols are reserved on Windows:
< (less than) > (greater than) : (colon) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk)
It should work fine if you change your path format to:
id_photo = mm + '-' + dd + '-' + yyyy + '-' + h + '_' + i + '_' + s; callback(null, id_photo + "-" + file.originalname);
相关问答
更多-
使用sdk,您无法写入内部存储的根目录。 这会导致您的错误。 编辑: 根据您的代码,使用内部存储与sdk: final File dir = new File(context.getFilesDir() + "/nfs/guille/groce/users/nicholsk/workspace3/SQLTest"); dir.mkdirs(); //create folders where write files final File file = new File(dir, "BlockForTest.t ...
-
错误:ENOENT:没有这样的文件或目录,在ionic2中打开(Error: ENOENT: no such file or directory, open in ionic2)[2022-10-29]
我使用的是ubuntu16.04,我忘记添加sudo命令,这是我在安装到最新版本时遇到的问题。 sudo npm install -g ionic@latest sudo npm install @ionic/app-scripts@latest 现在一切正常 I was using ubuntu16.04 and i forgot to add the sudo command befor that was my issue while installing to latest one. sudo np ... -
你错过了index.html路径中的public目录: res.sendFile(__dirname + '/public/index.html'); You're missing the public directory in the path to index.html: res.sendFile(__dirname + '/public/index.html');
-
看起来您的URL是文件路径而不是http网址。 ENOENT表示它正在尝试打开本地文件,但失败了。 检查调试器中的值。 Looks like your URL is a file path and not an http url. ENOENT indicates it is trying to open a local file, and failing. Check the value in a debugger.
-
Yeoman发生器错误 - ENOENT:窗口上没有这样的文件或目录(Yeoman generator error - ENOENT: no such file or directory on windows)[2022-03-25]
这是您使用的生成器的一个错误https://github.com/lidia-freitas/generator-aspnet-angular/issues/1 我建议在https://npms.io/search?q=yeoman-generators上搜索生成器,并尝试留在维护的生成器中。 有很多人发布破碎的开源软件包,所以如果你想节省一些时间,最好在使用它之前确保一个项目得到良好的维护:) That's a bug with the generator you used https://github. ... -
问题是您在路径中使用保留字符。 根据https://msdn.microsoft.com/en-us/library/aa365247在Windows上保留以下符号: < (less than) > (greater than) : (colon) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk) 如果将路径格式更改为:它应该可以正常工作。 id_ ...
-
对于Windows,最好在路径中使用\\以避免一些问题。 C:\\text.txt 我用这个路径包含pdftk.exe: C:\\PDFtk\\bin\\pdftk.exe For windows it's better to use \\ in the path to avoid some problems. C:\\text.txt This path I use to include pdftk.exe: C:\\PDFtk\\bin\\pdftk.exe
-
photoFile= new File(contentUri.getPath()); 查看contentUri.getPath()的值,看看它不是有效的文件系统路径。 相反,您应该为获得的uri打开一个InputStream,并从流中读取文件内容。 InputStream is = getContentResolver().openInputStream(contentUri); photoFile= new File(contentUri.getPath()); Have a look at the ...
-
我有同样的问题,我感动了 app.get('*', function (req, res) { res.sendFile(__dirname + '/public/index.html'); // load the single view file (angular will handle the page changes on the front-end) }); 在require('./app/routes.js')(app);下面的server.js require('./app ...
-
你的项目中只有错误的路径。 在Heroku上,您无法写入项目根目录下的文件夹。 在您的情况下,您的代码在app.js运行,该app.js位于项目的“root”文件夹中。 因此,在Heroku的文件系统上,这意味着您的项目如下所示: /app /app/app.js /app/public /app/public/images ... Heroku将您的所有代码放入名为app的文件夹中。 现在,在上面粘贴的代码中,您显示: Request(uri).pipe(fs.createWriteStream(__d ...