We have a requirement where client would send data as csv file. This file will be later processed via BPM process and record will be loaded into the creatio object. How and where this file can be stored within Creatio Cloud ?  

Please note the file is not an attachment to any record but rather records which is to be loaded in Creatio Database.

Like 0

Like

2 comments

Hello,
 

For product sites that are hosted in the Creatio cloud, AWS S3 buckets are connected by default and are used to store files.
You can also use the option of storing files in the database as well, but please note that this will lead to increased memory consumption at the database level.
When developing functionality that covers file uploads, we recommend using the "API for file management" that is built into Creatio products.
You can find a detailed description and examples of how to use the "API for file management" in an article on Creatio Academy, as well as the File storage options for storing files in Creatio.
 

Thank you.

Serhii Parfentiev,

Before deploying this on Creatio Cloud I need to develop this on my local Creatio set up

How to Validation of S3 Configuration:

"I have configured Amazon S3 as file storage in Creatio local following the 'File storage options ' guide. 
How can I validate that this S3 configuration is working correctly (I don't see anything in log)?
"Any existing API i can use to see how this work

What  Tables and Objects Involved in File Upload:

"Which Creatio tables or objects are involved in file upload and storage when using external storage like Amazon S3? Specifically, what tables store metadata and file details for uploaded files when it is not associated with any entity like Accounts or Contacts?

 Need these to access file from BPM"

Show all comments

Hello, colleagues. After generating a report, it is necessary to attach it as a file to the record, in the Files and links detail. The application from "customerfx" is not suitable. Here, it is necessary to automatically select the report form by pressing one button, etc. 

I ask for your help. Perhaps there is somewhere to look at the code. Or you can point to an article in the Academy, or something else.
As a last resort, I will analyze the principle of operation of the application from Ryan (customerfx").
Thank you all.

Like 0

Like

2 comments
Best reply

Not sure if I completely understand, however, if you're wanting to generate a printable and attach to a record, you can do this with a process using the Process File element. This allows you to generate a printable and you can easily attach to a record's files. Then, just wire up the button to run the process. 

Ryan

Not sure if I completely understand, however, if you're wanting to generate a printable and attach to a record, you can do this with a process using the Process File element. This allows you to generate a printable and you can easily attach to a record's files. Then, just wire up the button to run the process. 

Ryan

Ryan Farley,

Thanks, Ryan. That's what I did. I wrote a business process for generating different reports depending on the value of the reference field and adding them to the attached files. In the module, I added a button to call this business process with the transfer of the necessary parameters to it.

Show all comments

Good day.

 

Creatio has S3 integration, so there must be a S3 client inside. 

Where i can find it? Or any other possibilities to put file inside the current file storage.

 

In documentation i find example of storage implementation, witch i dont need because it is already contains S3 file storage integration.

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/back-end-development/api-for-file-management/examples/implement-a-file-content-storage

 

And a file data saved directly in database. This case is irrelevant too because im interested to put data in current storage (SysSetting ActiveFileContentStorage), not in database.

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

 

Appreciate any help. Thanks.

Like 0

Like

1 comments

Hello,
 

Uploading or accessing existing files should be done through the API for file management. 
We encourage you to read the documentation on the API for file management on Creatio Academy.
Also, in the documentation there is an example for creating new files using the Terrasoft.File.Abstractions.IFileFactory interface.

 

IFileFactory
 

Thank you.

Show all comments
Question

Hello, 

I added an object based on the File object, but I can't see the newly created object in the list of file storage locations. What could I be doing wrong?

Like 0

Like

3 comments

Hello,

For custom sections the files will be stored in SysFile object.

I need to add new columns that are specific to my section. Therefore, I have to create a new object. Is there a way to upload files into the newly created object?

Hello,

 

When a new attachment storage is created according to The File Management API. The file storage will be available in the list of objects the Freedom UI Attachments component works with.

Show all comments

We have an implementation of saving data in the "History" of Contacts, and we use the HttpWebRequest method like this POST. However, now every time we try to upload a file into the History email it returns this  Error: 'The remote server returned an error: (400) Incorrect Request.'.

private static bool TransferFile(Guid fileRecordId, string columnName, byte[] file) {
            log.Debug("[START] Transfer file");
            try {
                string requestUri = ServerUriUsr + "ActivityFileCollection(guid'" + fileRecordId.ToString() + "')/" + columnName;
                HttpWebRequest request = RequestHelper.BuildRequest(requestUri, HttpMethod.Put);
                request.Accept = "application/octet-stream,application/json;odata=verbose";
                request.ContentType = "multipart/form-data;boundary=+++++";
                // Recording the xml message to the request stream.
                using (Stream requestStream = request.GetRequestStream())
                {
                    requestStream.Write(file, 0, file.Length);
                }
                // Receiving a response from the service regarding the operation implementation result.
                using (WebResponse response = request.GetResponse())
                {
                    if (((HttpWebResponse)response).StatusCode == HttpStatusCode.Created)
                    {
                        // Processing the operation implementation result.
                        response.Close();
                        log.Debug("[END] Transfer file (Successful)");
                        return true;
                    }
                }
            }
            catch (WebException ex) {
                if (ex.Response is null)
                    log.Error($"TransferFile function error: {ex.Message}");
                else
                    log.Error($"TransferFile function error: {new StreamReader(ex.Response.GetResponseStream()).ReadToEnd()}");
                throw;
            }
            catch (Exception ex) {
                log.Error($"TransferFile function error: {ex.Message}");
                throw;
            }
 
            return false;
        }

The problem only occurs when I try to upload a .docx or .xlsx file

Like 0

Like

2 comments

Have you checked failed IIS requests logs and the applicaiton logs for more information on the invalid request? What was the result of the check?

Oleg Drobina,

I ended up doing more tests and the problem only occurs when it is a .docx and .xlsx type file.

When it is PDF or images it works normally without any problems.

Show all comments

Hello,

I am working on uploading a large amount of xlsx files into my system using Creatio's Data Import wizard. I am currently uploading them one at a time but I'm wondering if there would be any negative effect to uploading more than one file at a time. 

The wizard is creating Contact records and there isn't any overlap between the different xlsx files so I was wondering if I could run two imports at the same time. 

Like 0

Like

1 comments

Dear Kevin, 

It is highly not recommended to do more than one import at once. It may vastly slow down the system to the point that the system may even become inaccessible. 

Show all comments

Hi Team

I created a Node.js script to upload attachments using FileApiService.

Here is my script:

var axios = require('axios');

var fs = require('fs');

establish_connection();

 

async function establish_connection()

{

        axios.post('https://company_name.bpmonline.com/ServiceModel/AuthService.svc/Login',

        {

            "UserName":"xxxxxxx",

            "UserPassword":"xxxxxxxxxxx"

            

        }).then (function (response){

            console.log('Imported credentials cookie from BPM Online!')

            c=response.headers['set-cookie']

            var bpm_loader=c[0]

            bpm_loader = bpm_loader.replace('BPMLOADER=','')

            bpm_loader=bpm_loader.split(';')[0]

            var aspx_auth=c[1]

            aspx_auth = aspx_auth.replace('.ASPXAUTH=','')

            aspx_auth=aspx_auth.split(';')[0]

            var bpm_csrf=c[2]

            bpm_csrf = bpm_csrf.replace('BPMCSRF=','')

            bpm_csrf=bpm_csrf.split(';')[0]

            var user_name=c[3]

            user_name = user_name.replace('UserName=','')

            user_name=user_name.split(';')[0]

            var auth = 'BPMLOADER='+bpm_loader+'; .ASPXAUTH='+aspx_auth+'; BPMCSRF='+bpm_csrf+'; UserName='+user_name+';';

            console.log('Authentication Successful!')

            upload_attachments(auth,bpm_csrf)

        }).catch(error => {

            console.log(error)

        })

}

async function upload_attachments(auth,bpm_csrf) {

  let myPdf = fs.readFileSync("./file_name.pdf");

  let myData = myPdf.toString("base64");

 

  let myBody = {

    Name: "test.pdf",

    Data: myData,

    TypeId: '529bc2f8-0ee0-df11-971b-001d60e938c6',//This indicates that the type of the attachment is file

    Version: "1",

    Usr_reference_column_id: 'xxxxxguid_of_the_record_xxxxxxxx'

  };

 

  let options = {

    method: "POST",

    url: 'https://company_name.bpmonline.com/0/rest/FileApiService/Upload',

    headers: {

        "fileapi14998570381414":"",

      "cache-control": "no-cache",

      "Accept-Encoding": "gzip, deflate",

      "Cache-Control": "no-cache",

      Accept: "*/*",

      "Content-Type": "application/json;odata=verbose",

      Cookie:auth,

      BPMCSRF:bpm_csrf,

      "entitySchemaName":"Usr_id_of_the_file_section"

    },

    body: myBody,

    json: true

  };

 

  request(options, function(error, response, body) {

    if(!error)

    {

        console.log('Success!')

        console.log(response)

    }

    else

    {

        console.log('Failed!')

        console.log(error)

    }

  });

}

 

References: 

1. https://community.bpmonline.com/questions/sending-blob-file-node

2. https://community.bpmonline.com/questions/upload-files-case

3. https://community.bpmonline.com/questions/how-upload-attachments-odata

4. https://community.terrasoft.ru/questions/realizacia-peredaci-pdf-dokumenta-po-protokolu-odata-s-ispolzovaniem-http-zaprosov

5. https://community.terrasoft.ru/questions/fileapiservice-zagruzka-dokumenta-v-faily-i-primecania-crm-sistemy

 

I am able to establish connection (Authorization is successful) and getting SUCCESS for the attachment. But in the response, I am receiving 'Request Error'.

 

Questions:

1. Is my URL correct?

2. Is the way I specified file section name correct?

3. Do I need to add/delete/change my request body?

4. Do I need to create a MODULE in ADVANCED SETTINGS?

 

NOTE: I am using BPM'Online Studio.

Like 0

Like

1 comments

It's hard to say how it should be done on Node.js. However, there is an easy way to find if your request is correct. Please install "telerik fiddler" and catch the request that you send to bpm'online. For example, send file.jpg. Then open bpm'online and add the same file for example to a contact. Catch the request with fiddler too. Then compare those two requests. Your task is to create a functionality that will send exactly the same request. 

If you need an example on JS, please put a break point into the "upload" method in the ConfigurationFileApi module (in a browser) and add a file to a contact. You'll see how bpm'online generates the request. Please try to do the same on Node.js. 

Show all comments

Hi,

On case landing page there is file upload field, that file need to be copy to CRM with other normal fields values.

 

Any help will be highly appreciable.

 

Regards

Like 0

Like

1 comments

Unfortunately, landing pages don't allow uploading attachments. Please find more information about uploading attachments in the answer by the link below.

https://community.bpmonline.com/questions/attachments-and-notes-using-dataservices

Show all comments