403 attaching a file

Hi,

I’m trying to attach a file using the php api integration:

"hubspot/api-client": "^10.1.0"

I’ve the following code:

$file = new \SplFileObject($fileObj->getRealPath());$fileName = $fileObj->getClientOriginalName();try { return $this->client->files()->filesApi()->upload($file, null, "/", $fileName, null, json_encode([ "access" => "PRIVATE", "ttl" => "P2W", "overwrite" => false, "duplicateValidationStrategy" => "NONE", "duplicateValidationScope" => "EXACT_FOLDER" ]) );} catch (ApiException $e) { Log::channel('hubspot')->error('Error al subir archivo:' . PHP_EOL . $e->getMessage(), [ 'response' => $e->getResponseBody() ]); return false;}

I’ve the integration permission in alowing the file’s handling but I’m getting the following error from Cloudflare Ray / Hubapi.com:

My app integration permissions:

Hey, @psjavi :waving_hand: That looks like you triggered a block from Clodflare.

One question. At the bottom of the error screen, is there a Cloudflare Ray ID? If so, can you DM me the Ray ID and the Portal ID (HubID number) you used when getting this error, please?

Thanks! — Jaycee

Hi @Jaycee_Lewis
Is this enough for you? This is all that I see in the response.

Yes. I need you to copy and paste the Ray ID here. In this case, a screenshot won’t be enough.

Thanks! —Jaycee

Hi, the Ray ID is: 7f2ecdb41eb52fa1

Hello,

I think I have found the reason for the blockage, everything seems to point to the fact that your file storage provider is analysing the documents internally. I mean, the TXT file with which I am testing, has some internal notes with steps to follow to make some configurations in Amazon AWS.

It must be analysing the content and it must be finding some instruction as malicious. On the other hand, if I convert the file to PDF, for example, the file uploads correctly.

If I try a TXT with a normal paragraph, it attaches it without problems.

This is the content of the TXT file:

Crear el rol para la instancia y asignárselo a la instanciaInstalar el cliente por shelldpkg --print-architecturecoger la version de la arquitectura correspondientewget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.debsudo dpkg -i -E ./amazon-cloudwatch-agent.debPasos adicionales recomendados:sudo mkdir /usr/share/collectdcd /usr/share/collectdsudo touch types.dbúltimo paso de subir la config decir NoInicia el Cloudwatch Agentsudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -sRevisa el estado del Serviciosudo systemctl status amazon-cloudwatch-agent-----AccederLogsEC2https://docs.aws.amazon.com/es_es/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-commandline-fleet.htmlhttps://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/