Skip to main content

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. 

Hello ​@Freddy,

This is supported by Indicium. How are you setting the file path right now? The most likely cause of this not working is that you’re setting a relative path in a default procedure instead of an absolute path.

So instead of this:

set @file = 'sub_folder/file_name.ext';

Try this (where C:\my_storage_location is the base of your storage location):

set @file = 'C:\my_storage_location\sub_folder\file_name.ext'

I hope this helps.


Hello ​@Freddy,

This is supported by Indicium. How are you setting the file path right now? The most likely cause of this not working is that you’re setting a relative path in a default procedure instead of an absolute path.

So instead of this:

set @file = 'sub_folder/file_name.ext';

Try this (where C:\my_storage_location is the base of your storage location):

set @file = 'C:\my_storage_location\sub_folder\file_name.ext'

I hope this helps.

Hi ​@Vincent Doppenberg 

Does this work for linux?  And it should incorporate the base file path?  like 

/var/shared/file/folder/folder/file.pdf

And it will make the folders? Or do they need to exist?  

I'm not really getting it to work. 


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.".
 


Hi ​@Dick van den Brink , thanks for the feedback. I will test it soon again and i'll let you know. I think i didn't incorporated the base path and also was fiddling with the subpath in the SF. But good to hear that in should work. 


Reply