# POST /filemanager/api/v3/files/upload not working

**URL:** <https://community.hubspot.com/t/post-filemanager-api-v3-files-upload-not-working/99398>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [February 4, 2024, 12:52pm UTC](https://community.hubspot.com/t/post-filemanager-api-v3-files-upload-not-working/99398 "2024-02-04T12:52:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelbird](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pixelbird/32/25270_2.png) [@pixelbird](https://community.hubspot.com/u/pixelbird)\
**Post date:** [February 4, 2024, 12:52pm UTC](https://community.hubspot.com/t/post-filemanager-api-v3-files-upload-not-working/99398/1 "2024-02-04T12:52:29Z")

</div>

I am not having any luck hitting the api or generating any logs in the private app, while other functions do.  
This is the code that calls the function

\<?php

// This example uploads a local file named ‘example\_file.txt’  
// to the /docs folder, without checking for duplicate files

$endpoint = “[https://api.hubapi.com/filemanager/api/v3/files/upload](https://api.hubapi.com/filemanager/api/v3/files/upload)”;

$upload\_file = new CURLFile(‘/home/cpaneluser/public\_html/subdomain/wp-content/uploads/documents/text.pdf’,‘application/octet-stream’);  
$file\_options = array(  
“access” =\> “PUBLIC\_INDEXABLE”,  
“overwrite” =\> false,  
“duplicateValidationStrategy” =\> “NONE”,  
“duplicateValidationScope” =\> “ENTIRE\_PORTAL”  
);

$properties = array(  
“file” =\> $upload\_file,  
“options” =\> json\_encode($file\_options),  
“folderPath” =\> “/docs”  
);

return hubspotApiSendFile($endpoint, $properties)  
?\>  
this is the function it calls  
function hubspotApiSendFile($endpoint, $properties){  
print “running”;  
// HubSpot Bearer Token  
$hubspot\_access\_token = ‘pat-na1-00ece814-xxxx-xxxx-xxxx-8b9345de889c’;  
$ch = curl\_init();  
@curl\_setopt($ch, CURLOPT\_URL, $endpoint);  
@curl\_setopt($ch, CURLOPT\_CUSTOMREQUEST, “POST”);  
@curl\_setopt($ch, CURLOPT\_POSTFIELDS, $properties);  
@curl\_setopt($ch, CURLOPT\_HTTPHEADER, array(  
‘Content-Type: application/json’,  
'Authorization: Bearer ’ . $hubspot\_access\_token // Include the authorization header  
));  
@curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, true);  
// Execute cURL session  
$response = @curl\_exec($ch);  
$status\_code = @curl\_getinfo($ch, CURLINFO\_HTTP\_CODE);  
echo $status\_code . " " . $response;  
// Check for cURL errors  
if (@curl\_errno($ch)) {  
error\_log('cURL error: ’ . @curl\_error($ch));  
} else {  
// If no cURL errors, process the response  
$response = json\_decode($response, true);  
}  
// Close cURL session  
@curl\_close($ch);  
}  
I know there is something silly I am not doing, I just cant work out what it is? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pixelbird](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pixelbird/32/25270_2.png) [@pixelbird](https://community.hubspot.com/u/pixelbird)\
**Post date:** [February 4, 2024, 12:55pm UTC](https://community.hubspot.com/t/post-filemanager-api-v3-files-upload-not-working/99398/2 "2024-02-04T12:55:42Z")

</div>

Here are the current slopes

 ![Screenshot 2024-02-04 at 10.54.57 pm.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/d/dd9c0fdb79bcdb175c9f6bc71379c5e09ca81697.jpeg)
