CFFILE 归属错误,操作 =“重命名”,表示文件无效
我的页面上有一个表单,通过 ajax post 与 CFC 交互。当用户更改文本并单击“保存”时,它应该更新数据库(它会这样做),并用他们输入的值重命名照片。一切正常,除了我不断收到错误:
属性源的值,当前 /Applications/ColdFusion8/wwwroot/theClient/staging/admin/images/Old_Image.jpg 无效。
该文件存在,我已将其更改为每个人都可以读/写,但 ti 仍然给我错误。
有什么想法吗?
我应该指出,我的 CFC 中的 var 运行空格替换并将其更改为下划线,因此文件名中没有空格...
My page has a form on it that interacts with a CFC via an ajax post. When the user changes the text and clicks save it should update the DB, which it does, and rename a photo with the value they typed in. Everything works except that I keep getting the error:
The value of the attribute source, which is currently /Applications/ColdFusion8/wwwroot/theClient/staging/admin/images/Old_Image.jpg, is invalid.
The file exists and I've changed it to read/write for everyone but ti still gives me the error.
Any ideas?
I should point out that a var in my CFC runs a replace for spaces and changes them out for underscores so, there's no spaces in the filename...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果我没记错的话,这可能是目标文件名的问题,而不是源文件名的问题。我认为这是 CF 中的错误消息的错误。
If I remember right this is probably a problem with the destination file name rather then the source filename. I think it's a bug with the error message in CF.
问题可能是您正在使用源文件的相对路径。问题是,源属性中的相对链接是相对于 ColdFusion 临时目录的。尝试给出绝对路径或使用 EXPANDPATH 函数创建资源的绝对路径,如下所示:
来自 CFFILE action="rename" 的 CF 9 文档
The problem might be that you are using a relative path to the source file. The problem is, relative links in the source attribute are relative to the ColdFusion temporary directory. Try giving an absolute path or using the EXPANDPATH function to create an absolute path to your resource like this:
From the CF 9 documentation on CFFILE action="rename"
我遇到了同样的问题,最后是别的问题:ColdFusion 用户在文件夹中没有“修改”权限。它具有读/写功能,但不能修改。 (叹!)
I had the same issue and in the end it was something else: the ColdFusion user had no "modify" permission in the folder. It had read/write but not modify. (sigh!)