0
Gmail API를 사용하여이 메시지에서 첨부 된 파일을 다운로드하려고했습니다. 지금까지,이 정보를 얻을 수 있습니다 : 나는 그것을 다운로드하려고 할 때 Gmail API가 PHP로 첨부 파일을 다운로드 중입니다.
Google_Service_Gmail_Message Object
(
[collection_key:protected] => labelIds
[internal_gapi_mappings:protected] => Array
(
)
[historyId] => 1571
[id] => 155e27d1fe295bbd
[internalDate] => 1468383698000
[labelIds] => Array
(
[0] => SENT
[1] => INBOX
[2] => IMPORTANT
)
[payloadType:protected] => Google_Service_Gmail_MessagePart
[payloadDataType:protected] =>
[raw] =>
[sizeEstimate] => 19335
[snippet] => POPOY
[threadId] => 155e27d1fe295bbd
[modelData:protected] => Array
(
[payload] => Google_Service_Gmail_MessagePart Object
(
[collection_key:protected] => parts
[internal_gapi_mappings:protected] => Array
(
)
[bodyType:protected] => Google_Service_Gmail_MessagePartBody
[bodyDataType:protected] =>
[filename] =>
[headersType:protected] => Google_Service_Gmail_MessagePartHeader
[headersDataType:protected] => array
[mimeType] => multipart/mixed
[partId] =>
[partsType:protected] => Google_Service_Gmail_MessagePart
[partsDataType:protected] => array
[modelData:protected] => Array
(
[headers] => Array
(
[0] => Array
(
[name] => MIME-Version
[value] => 1.0
)
[1] => Array
(
[name] => Received
[value] => by 10.140.92.230 with HTTP; Tue, 12 Jul 2016 21:21:38 -0700 (PDT)
)
[2] => Array
(
[name] => Date
[value] => Wed, 13 Jul 2016 12:21:38 +0800
)
[3] => Array
(
[name] => Delivered-To
[value] => [email protected]
)
[4] => Array
(
[name] => Message-ID
[value] =>
)
[5] => Array
(
[name] => Subject
[value] => test w/ attachment
)
[6] => Array
(
[name] => From
[value] => Chris Jason Barredo
)
[7] => Array
(
[name] => To
[value] => Chris Jason Barredo
)
[8] => Array
(
[name] => Content-Type
[value] => multipart/mixed; boundary=001a11c13ea0c1971805377cb89b
)
)
[body] => Array
(
[size] => 0
)
[parts] => Array
(
[0] => Google_Service_Gmail_MessagePart Object
(
[collection_key:protected] => parts
[internal_gapi_mappings:protected] => Array
(
)
[bodyType:protected] => Google_Service_Gmail_MessagePartBody
[bodyDataType:protected] =>
[filename] =>
[headersType:protected] => Google_Service_Gmail_MessagePartHeader
[headersDataType:protected] => array
[mimeType] => multipart/alternative
[partId] =>
[partsType:protected] => Google_Service_Gmail_MessagePart
[partsDataType:protected] => array
[modelData:protected] => Array
(
[headers] => Array
(
[0] => Array
(
[name] => Content-Type
[value] => multipart/alternative; boundary=001a11c13ea0c1970b05377cb899
)
)
[body] => Array
(
[size] => 0
)
[parts] => Array
(
[0] => Array
(
[partId] => 0.0
[mimeType] => text/plain
[filename] =>
[headers] => Array
(
[0] => Array
(
[name] => Content-Type
[value] => text/plain; charset=UTF-8
)
)
[body] => Array
(
[size] => 7
[data] => UE9QT1kNCg==
)
)
[1] => Array
(
[partId] => 0.1
[mimeType] => text/html
[filename] =>
[headers] => Array
(
[0] => Array
(
[name] => Content-Type
[value] => text/html; charset=UTF-8
)
)
[body] => Array
(
[size] => 28
[data] => PGRpdiBkaXI9Imx0ciI-UE9QT1k8L2Rpdj4NCg==
)
)
)
)
[processed:protected] => Array
(
)
)
[1] => Google_Service_Gmail_MessagePart Object
(
[collection_key:protected] => parts
[internal_gapi_mappings:protected] => Array
(
)
[bodyType:protected] => Google_Service_Gmail_MessagePartBody
[bodyDataType:protected] =>
[filename] => popoy.jpeg
[headersType:protected] => Google_Service_Gmail_MessagePartHeader
[headersDataType:protected] => array
[mimeType] => image/jpeg
[partId] => 1
[partsType:protected] => Google_Service_Gmail_MessagePart
[partsDataType:protected] => array
[modelData:protected] => Array
(
[headers] => Array
(
[0] => Google_Service_Gmail_MessagePartHeader Object
(
[internal_gapi_mappings:protected] => Array
(
)
[name] => Content-Type
[value] => image/jpeg; name="popoy.jpeg"
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
[1] => Google_Service_Gmail_MessagePartHeader Object
(
[internal_gapi_mappings:protected] => Array
(
)
[name] => Content-Disposition
[value] => attachment; filename="popoy.jpeg"
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
[2] => Google_Service_Gmail_MessagePartHeader Object
(
[internal_gapi_mappings:protected] => Array
(
)
[name] => Content-Transfer-Encoding
[value] => base64
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
[3] => Google_Service_Gmail_MessagePartHeader Object
(
[internal_gapi_mappings:protected] => Array
(
)
[name] => X-Attachment-Id
[value] => f_iqkdq8dk0
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
)
[body] => Google_Service_Gmail_MessagePartBody Object
(
[internal_gapi_mappings:protected] => Array
(
)
[attachmentId] => ANGjdJ-18nbgORhdtkl3nD4dezCwSPODA0qgR7UsIeoGWQp8xIC4VFCvxP0xRUkMGQYm1uAqbMTP8L_wMgZFA1IEy5FXwgXeJOW9UmJGB87SuBIjNezVlXOY-6OhbxMktWTfgkiGx4Eb6dhFkrY-iWvbOWEjmWajiT54oj0SoaHQvNXGI-HmZZ2L6m62DHSPQCWn0qSRZsMcxddXSlczatQtCcjvMR7Hy9rhoNxe2Rd2bf_jU2PyHbsQxtvaWvp-lx_fnBrcWX5pjWhW5x3XWzrxhgRIF4xJfGa_fqV7g-G750vqbj5vRRAWX_cPvuU
[data] =>
[size] => 18308
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
)
[processed:protected] => Array
(
[body] => 1
[headers] => 1
)
)
)
)
[processed:protected] => Array
(
[parts] => 1
)
)
)
[processed:protected] => Array
(
[payload] => 1
)
)
지금까지, 내가 파일을 받고 있어요,하지만 나는 그것을 열 때, 나는 파일을 볼 수 없습니다입니다. 손상된 파일처럼 보입니다.
큰 도움을 주셔서 감사합니다. –
도움이 되었기 때문에 기쁩니다! – trajchevska
안녕하세요 trajchevska 당신은 Gmail 업 그레 이드 파일을 업로드 할 수 있고 Gmail API의 문서가 자바에 있지만 PHP가 필요하기 때문에 첨부 파일로 보낼 수있는 Gmail api에서 아이디어가 있습니까 –