编辑:似乎在上次更新后此问题不再存在,至少到目前为止
每当我尝试上传文件时,我都会在上传时获得以下错误和成功的组合.
[5/20/14 7:20 PM] Upload to ***
[5/20/14 7:20 PM] Failed to transfer file 'C:\wamp\www\***\wp-content\plugins\woocommerce\includes\class-wc-api.php': could not create FTP directory "ftp://ftp.***.com/woocommerce".
[5/20/14 7:21 PM] Upload to ***
[5/20/14 7:21 PM] Upload to *** completed in less than a minute: 1 file transferred (3.7 Kb/s)
[5/20/14 7:21 PM] Upload to ***
[5/20/14 7:22 PM] Failed to transfer file 'C:\wamp\www\***\wp-content\plugins\paymentez-wooc-gateway\index.php': could not close the output stream for file "ftp://ftp.***.com/paymentez-wooc-gateway/index.php".
Run Code Online (Sandbox Code Playgroud)

我已禁用我的防火墙,没有运气,我已尝试在ftp中的被动模式和同样的问题,我可以在同一个ftp帐户上使用filezilla上传相同的文件和文件夹,所以我认为问题是在phpstorm,不确定如果是我的错误或配置错误.我在其他网站托管在不同的服务器上有这个问题,我不太确定,但我不记得在Windows 7下有这个问题,现在我在Windows 8下.
有时它上传正常,大部分时间都失败了.
任何想法都非常感谢,谢谢.
我在我的表单中嵌套信息以匹配我的模型,这大大简化了后端的内容,但我无法找到如何在Sails.js中获取数组或对象(或两者的组合)
假设我有这样的表格
注意:完全需要支持"multipart/form-data".
<form action="/articles" method="post" enctype="multipart/form-data">
<input type="file" name="status" value="published">
<!-- Entry 0 -->
<input(type="text" name="entries[0][title]" value="Entry 1")
<input(type="text" name="entries[0][content]" value="Entry 1 Content...")
<!-- Entry 1 -->
<input(type="text" name="entries[1][title]" value="Entry 2")
<input(type="text" name="entries[1][content]" value="Entry 2 Content...")
<!-- images -->
<input type="file" name="images[]">
<input type="file" name="images[]">
</form>
Run Code Online (Sandbox Code Playgroud)
我希望在req.params.all()obj中得到这样的对象
{
status: 'published',
entries: [
{title: 'Entry 1', content: 'Entry 1 Content...'},
{title: 'Entry 2', content: 'Entry 2 Content...'}
]
}
Run Code Online (Sandbox Code Playgroud)
现在打电话req.params.all()/ req.body我得到的是:
{
status: 'published',
'entries[0][title]': 'Entry …Run Code Online (Sandbox Code Playgroud) 我正在使用sails.js waterline orm.现在这不是一个特别的帆问题,但我必须放置一些上下文,所以当你创建一个记录时,你会得到一个创建了数据的对象.如果记录具有关联的其他记录(集合),则它具有与返回对象中的那些相关的键,但是这些键是getter/setter,即使这些相关对象不存在数据.
我简化了一些事情只是为了揭示主要观点.
这是我的用户模型:
var User = {
attributes:
status: {type:'string'}
images: {
collection: 'Image'
}
}
Run Code Online (Sandbox Code Playgroud)
让我们失望,我在User模型上执行了一个创建查询,该模型具有关联的图像集合.userRecord是查询返回的内容.如果我在console.log中显示它显示与模型本身相关的属性但不显示相关记录,即使密钥实际存在,您也可以访问它,但即使设置显示,也无法访问console.log或utils.inspec隐藏到真实.
console.log(userRecord)
Run Code Online (Sandbox Code Playgroud)
这是返回的内容
{ name: 'zaggen'}
Run Code Online (Sandbox Code Playgroud)
这应该归还
{ name: 'zaggen',
images: [{
path: 'some-path/img.png'
}]
}
Run Code Online (Sandbox Code Playgroud)
我可以像这样访问隐藏的属性:
console.log(userRecord.images[0].path)
// outputs some-path/img.png
Run Code Online (Sandbox Code Playgroud)
这怎么可能呢?,据我所知,没有办法将信息隐藏到节点中的console.log,除非在__proto__对象中定义属性,但在这种情况下它们不是.
在寻找这个之后,我没有找到任何东西,它非常奇怪,所以我认为这可能是一个很好的问题.它可以帮助我的工作过程,如果我可以console.log这个信息并获取所有数据,现在我可以使用lodash并调用克隆或默认值,我得到它应该的对象.
我正在使用sails 构建一个应用程序,每次我让服务器运行超过几分钟时,我的CPU 都会跳到稳定的100% 使用率。我在我的资产中包含了大量较少的文件,我相信我的问题就在这里。是否有任何其他原因可能会发生这种情况?
我按照这些步骤构建了我的第一个sailsjs MVC应用程序:
sudo apt-get install nodejsnodejs -v 返回v0.10.25sudo apt-get install npmnpm -v 返回1.3.10sudo npm install -g sails 之后我得到以下错误:
npm http GET https://registry.npmjs.org/sails
npm http 304 https://registry.npmjs.org/sails
npm WARN engine sails@0.11.3: wanted: {"node":">= 0.10.0","npm":">= 1.4.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
> sails@0.11.3 preinstall /usr/local/lib/node_modules/sails
> node ./lib/preinstall_npmcheck.js
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! weird error 127
npm …Run Code Online (Sandbox Code Playgroud)