Get file contents off a file upload field

Get file contents off a file upload field

Hi

I have been struggling with getting uploaded file contents in ZOHO CRM using DELUGE.
I have a custom module that has a file upload field were users should upload an XML file

I have been able to retrieve the URL of the file but not the contents. There seems to be no way to get it directly so I have been trying to download the file again via API

  1. if(factura.get("Archivo_XML")!=null)
  2. {
  3.     file = factura.get("Archivo_XML");
  4.     info file;
  5.     url = file.toCollection().get("download_Url");
  6.     url = "https://crm.zoho.com" + url;
  7.     info url;
  8.     // to fetch file from the cloud using invokeUrl task
  9.      fileVariable = invokeUrl
  10.      [
  11.       url: url
  12.       type: GET
  13.       connection : "zoho_crm"
  14.      ];
  15.     
  16.      // to fetch the file content
  17.      response = fileVariable.getFileContent();
  18.      info response;
  19.     
  20. }
I can get the file with that URL just fine, but when I inspect fileVariable, I see that it's getting https://crm.zoho.com as a non authenticated user.

What do I have to send in addition to what I send already to be able to get the XML data?

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now