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.
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.
Correct, the folders are protected by user permissions that are enforced by WebDAV and the file system. And, the assets folder is not intended to be a file storage mechanism for uploads as you are using in this capacity.
Is there a reason that you are placing files in assets as opposed to attaching them to incident or contact objects that would be within the context of someone operating within Customer Portal?
If you're looking to build some sort of content management into Customer Portal, then I'd suggest using a separate product for file storage that provides an API where you can manage files with more granularity, like Oracle Cloud Data Storage, where you can then serve these files from in CP.