I feel like I\'m missing something stupid...
I\'m using the PHP SDK for the new Gmail API to fetch an attachment from an email. I can get the attachment content, but un
You also need to join the path of where you want to store your file with the filename part of the message payload.
I'm not particularly well versed in php, but in python it would be the equivilent of:
path = ''.join([store_dir, part['filename']])
f = open(path, 'w')
f.write(file_data)
f.close()
Where the file_data
is what you have decoded (your $data
)