I created a Flow that is triggered from an app button. If I choose to include the "file attachment" option the user is able to attach a file or use the built in camera. However, any images taken with the camera are uploaded as a byte stream instead of a picture.
I would like to convert the byte stream into a .jpeg or .png and attach it to an email, any suggestions?
If it is possible it would also be great if it could be compressed on the way instead of attaching a full sized 3mb picture.
Thanks!
Solved! Go to Solution.
Hi @aldenniklas,
Could you provide the specific details of your app?
It seems that you want to change the format of the image uploaded by the user.
I did the test on my side, instead of using the PowerApps button, I used the button inside Flow directly, asking the user to select a local file.
The file content is also passed as contentBytes.
If you can get the contents of the file and the name of the file, you could try changing the extension of the file when configuring Send an email-Attachment.
If you can get the file name with extension, you could first remove the file's extension, and then use the concat() function to add the ".png/.jpeg".
To remove extensions, you could refer to such an expression:
replace(‘filename’,concat('.',last(split(‘filename’,'.'))),'')
The configuration of Send an email is as below:
Please take a try if it helps.
Best Regards,
Barry
Hi @aldenniklas,
Could you provide the specific details of your app?
It seems that you want to change the format of the image uploaded by the user.
I did the test on my side, instead of using the PowerApps button, I used the button inside Flow directly, asking the user to select a local file.
The file content is also passed as contentBytes.
If you can get the contents of the file and the name of the file, you could try changing the extension of the file when configuring Send an email-Attachment.
If you can get the file name with extension, you could first remove the file's extension, and then use the concat() function to add the ".png/.jpeg".
To remove extensions, you could refer to such an expression:
replace(‘filename’,concat('.',last(split(‘filename’,'.'))),'')
The configuration of Send an email is as below:
Please take a try if it helps.
Best Regards,
Barry