2
API를 사용하여 Google 웹 로그 분석에 CSV를 업로드해야합니다. 모든 것이 정상적으로 처리되지만 열의 파일 이름에 "알 수없는 파일 이름"이 표시됩니다.uploadData의 파일 이름
$analytics = new \Google_Service_Analytics($client);
try {
$analytics->management_uploads->uploadData(
'<acc id>',
'UA-xxx',
'xxxxxxxxxxxxxx',
array(
'data' => file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/ex.csv'),
'mimeType' => 'application/octet-stream',
'uploadType' => 'media'
)
);
} catch (apiServiceException $e) {
print 'There was an Analytics API service error '
. $e->getCode() . ':' . $e->getMessage();
} catch (apiException $e) {
print 'There was a general API error '
. $e->getCode() . ':' . $e->getMessage();
}
이 flename와 파일을 게시 할 수 있습니다 : 여기
내 코드? 고맙습니다!
나는 최근에 같은 질문을했으며 현재 API를 통해 파일 이름을 추가 할 수 없다는 사실을 발견했습니다. –