(Before I explain, please note I've read about 5-10 other threads here on this forum about corrupt PDF attachments and none of the "solved" answers were really solutions. I've been at this for 6 hours now and am losing my mind.)
I have an online form that customers use to purchase ebooks. Flow starts when the form is submitted, and it's supposed to send purchased ebooks as email attachments via Gmail.
How the flow basically works:
{ "Name": "body('Get_file_metadata_using_path')?['Name']", "ContentBytes": "body('Get_file_content_using_path')", "ContentType": "body('Get_file_metadata_using_path')?['MediaType']" }
Now, the email does get sent and the files do get attached - file sizes and names are okay.
BUT, the files are corrupted, I can't open or preview them.
I've tried so many things ... not using the array variable and just sending the files as is (adding the "File Content" dynamic content in the attachment field), tried using base64() conversion, base64toBinary(), just binary(), all possible conversions - I don't even know what these do. I tried changing filenames, tried declaring values with or without quotation marks, tried sending the email via SendGrid instead of Gmail, I just don't know what else to do and this thing is utterly broken.
Help!
Screenshots:
https://ibb.co/dk64U9 -- Flow
https://ibb.co/m6sNGp -- Corrupted PDF
https://ibb.co/hZSB99 -- Corrupted PDF
Solved! Go to Solution.
Does this happen with any PDF? Or only with larger PDFs?
Does this happen with any PDF? Or only with larger PDFs?
Thank you!!
I didn't even think of file size because I was testing with 2-3 relatively small files (less than 2MB each) - but it looks like there's a limitation of around 5MB.
I removed the Gmail connector and used SMTP instead - it works!
Join digitally, March 2โ4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
86 | |
58 | |
41 | |
35 | |
32 |
User | Count |
---|---|
79 | |
67 | |
57 | |
49 | |
40 |