$filename = '/home/familysearch/public_html/fst' . $_POST['story_id'] . '.pdf';
$title = str_replace(" ", "+", $_POST['title']);
$filelink = 'fst' . $_POST['story_id'] . '.pdf';
$client = new Client();
$response = $client->post($url, [
'headers' => [
'Content-Type' => 'multipart/form-data; boundary=Boundary_5_1593431620_1418337402143',
'Authorization' => 'Bearer ' . $_POST['access_token'],
'MIME-Version' => '1.0'
],
'body' => [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'form-data; name="' . $title . '"',
'pdf_filed' => fopen($filename, 'rb')
]
]);