cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shaye
New Member

Microsoft Flow - Extract zipped email attachment on incoming email to folder on OneDrive

Hi All,

 

I'm finding Microsoft Flow to be extremely frustrating and wondering if here is help available here!

 

I'm trying to setup a flow based on the subject line of an email so that the attachment gets unzipped to a folder on OneDrive (please see image below) as it comes in to my mail box.

 

I get an error which I do not understand.

 

My understanding is that 'On new email' task I have set it to take emails with the specified subject line, then pass that attachment to 'Extract archive folder' under 'Apply to each Attachment on email'. So now that task should extract the zipped attachment to the folder specified below.

 

2020-03-13 11_00_12-Window.jpg

 

When I test the Flow and get the error:

 

2020-03-13 11_18_12-Run History _ Power Automate.jpg

 

Thanks

 

 

 
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Shaye 

I have tested the flow and you are right. After a little of investigation, I discovered that the media type value is application/x-zip-compressed.

On the other hand, it's not possible to extract an password protected zip file, as stated in this thread: https://powerusers.microsoft.com/t5/General-Power-Automate/Password-protected-zip-files/td-p/29184 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

9 REPLIES 9
fchopo
Super User II
Super User II

Hello @Shaye 

Have you checked if the attachment is a zip file? Have a look at this example:

Extract.png

The steps are the following:

1) We check if the email Has Attachments (Has Attachments is equal to true).

2) For each attachment, create a file in OneDrive.

3) If the file is a zip compressed file (Media Type is equal to application/zip)

4) Extract the archive to the folder.

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hi @fchopo,

 

Thanks for your help on this. I followed your instructions and it moves the file to my desired folder but does not unzip.

 

The file type is: WinRAR ZIP archive (.zip) and it is password protected (which I forgot to mention previously).

 

Do you know how I an supply the password to flow assuming that is the issue?

 

Thanks

 

-PS - I should add that Condition 2 came out as False even though I set it to: application/zip

Hello @Shaye 

I have tested the flow and you are right. After a little of investigation, I discovered that the media type value is application/x-zip-compressed.

On the other hand, it's not possible to extract an password protected zip file, as stated in this thread: https://powerusers.microsoft.com/t5/General-Power-Automate/Password-protected-zip-files/td-p/29184 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

Thanks @fchopo 

 

Your solution is still useful knowledge. Shame about the password issue.

 

Cheers!

Is it possible to unzip password protected .zip files using flow?

fchopo
Super User II
Super User II

Hi @aishwaryab 

No, it's not possible.

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Daimao666
New Member

Does this save both the zip and extracted file to the folder ? If it does, can you autodelete it afterwards ?

hello @fchopo ,

 

 where can I find the media type to precise the value is application/x-zip-compressed?
I only whant to get the Zip file inside the email and not the others attachements like the images etc

 

thanks

fchopo
Super User II
Super User II

Hi @Kesia 

You can read the content-type value from the get attachment action:

attachment.png

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,515)