From 87274352165bc2a9beaba3617c18ae8e0417c1cc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 8 Nov 2018 13:58:37 +0100 Subject: [PATCH] Update API for download more infos for easiest & better use of the generated file by API --- htdocs/api/class/api_documents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 66c293f2cb0..23ed35428d3 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -103,7 +103,7 @@ class Documents extends DolibarrApi } $file_content=file_get_contents($original_file_osencoded); - return array('filename'=>$filename, 'content'=>base64_encode($file_content), 'encoding'=>'MIME base64 (base64_encode php function, http://php.net/manual/en/function.base64-encode.php)' ); + return array('filename'=>$filename, 'content-type' => mime_content_type($original_file),'content'=>base64_encode($file_content), 'encoding'=>'base64' ); }