0

In Service Cloud (FKA RightNow) Customer Portal, isn't the "assets" folder writable?

I'm trying to upload a file to a subfolder inside the "assets" folder but I seem to be running into permission issues. The code I'm using is:

$file_name = "File_".time().".txt";
if(move_uploaded_file($_FILES['upload']['tmp_name'], HTMLROOT . '/euf/assets/uploads/text/'.$file_name))
{
    header("Location: /app/read_file/file_name/".$file_name);
    exit;
}

This is throwing an error which states:

Access to move_uploaded_file is denied because its trying to access restricted folders in ......

Is there no way to save the uploaded file into the "assets" subfolder via PHP?

EDIT:

The destination seems to be correct as if I use:

echo HTMLROOT . '/euf/assets/uploads/text/'.$file_name

it prints:

/vhosts/sitename/euf/assets/upload/text/File_1480674311.txt

So the correct filepath is being referenced but somehow the framework is not allowing me to save it in there.

Update

The use case is such that via the CP, a person will upload a CSV/TXT file. This file would contain contact info (name, email etc) which will then be read (at a later stage) to create contacts in OSvC. This would be a recurring process, perhaps twice or thrice a month.

Since the reading of the file will not happen at the time of upload, storing the file someplace is the ideal solution.

4

2 回答 2

1

在资产文件夹中存储联系人记录或任何其他敏感数据是非常糟糕的做法。这些文件像资产文件夹中存储的任何其他文件一样向公众开放 - css、js、图像......

文件结构中还有其他文件夹更适合此目的。它们只能从代码级别访问。

您是否有机会使用 v16.8?

于 2016-12-03T20:53:18.117 回答
1

正确,文件夹受 WebDAV 和文件系统强制执行的用户权限的保护。并且,assets 文件夹不打算作为您在此容量中使用的上传文件存储机制。

您是否有理由将文件放置在资产中,而不是将它们附加到在客户门户中操作的某人的上下文中的事件或联系人对象?

如果您希望在客户门户中构建某种内容管理,那么我建议您使用单独的文件存储产品,该产品提供了一个 API,您可以在其中更精细地管理文件,例如 Oracle 云数据存储,您可以在其中然后从 CP 中提供这些文件。

于 2016-12-02T15:05:11.163 回答