I'm trying to upload files onto a local storage. Now it's a bit unwanted to have everything in one folder, so i'm trying to incorporate the subfolder like 'contract', but it doesn't seem to be supported. What is the status of supporting the subfolder using the file upload API (Indicium)? It surely cannot be a fixed value only from the SF.
File upload with local storage and subfolder indication
Best answer by Dick van den Brink
Hi Freddy,
I just tested this on Linux. I created a table, with a "filename" column with the VARCHAR(1024)
datatype.
The column uses a domain with the control set to "File upload" and the following base path in the storage provider: /tmp/indicium/files
In my case, I created the /tmp/indicium
directory manually - but did not create the files
directory.
In the default procedure I hardcoded the filename to the following, to make the test a bit easy:
if @cursor_from_col_id = 'filename'
begin
set @filename = '/tmp/indicium/files/my-subdir/my-test.txt'
end
So yes, the base path should be included when setting it from the default and it should also be a child of the one configured in the SF. It is not allowed to have a path in the SF of /tmp/indicium/files
and change it in the default to /home/dvdbrink/indicium/files/test.txt
.
After the /commit
call the files
and my-subdir
got created and the file was saved correctly.
I hope this gives enough information to make it work on your end. If not, do you get any errors on the /commit call? or what exactly do you mean by "I'm not really getting it to work.".
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.