cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Cannot Write Zip File to Local Drive from E-Mail Attachment

I am in the development stage of a project.

 

As a test, I have zipped up a file and sent it in an attachment to the e-mail account where the Flow is set up.  I already successfully set up a gateway.  However, the "Create File [File System]" step does not appear to be outputting the zip file properly.

 

In the trigger "When a new email arrives", I see the attachment's ContentType is properly read as "application/x-zip-compressed".  However, in the output of the "Create File" step, the file either comes out as "application/octet-stream" when I don't enter in an extension (like .zip) in the "File name" portion of this step or it comes out as "application/x-zip-compressed" when I enter in ".zip" at the end of the file name.  The latter result appears desirable except when I go to my directory to open the newly written ".zip" file, it says "Windows cannot open the folder.  The Compressed (zipped) Folder 'C:\xxx xxxx xxx\xxxxx\xxxx\xxxx\test.zip' is invalid."

 

Am I missing something?  Please let me know if you need additional information.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Cannot Write Zip File to Local Drive from E-Mail Attachment

Hi @BrennenLowe ,

 

Please refer to screenshot below to create the flow:

1.png

The expression in the File Name field as below:

concat(first(split(items('Apply_to_each')?['name'],'.')),formatDateTime(utcNow(),'yyyy-MM-dd'),last(split(items('Apply_to_each')?['name'],'.')))

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: Cannot Write Zip File to Local Drive from E-Mail Attachment

Hello,

 

I have discovered with a co-worker that it works fine if I supply "File name" with the dynamic content of "Attachments Name".

 

I was originally trying to give it a new name with today's date appended to it but Flow must not have liked that and had trouble with the file type.  Why is that?

 

Thanks.

Highlighted
Community Support
Community Support

Re: Cannot Write Zip File to Local Drive from E-Mail Attachment

Hi @BrennenLowe ,

 

I would make a test and reply here once the flow is finished.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Community Support
Community Support

Re: Cannot Write Zip File to Local Drive from E-Mail Attachment

Hi @BrennenLowe ,

 

Please refer to screenshot below to create the flow:

1.png

The expression in the File Name field as below:

concat(first(split(items('Apply_to_each')?['name'],'.')),formatDateTime(utcNow(),'yyyy-MM-dd'),last(split(items('Apply_to_each')?['name'],'.')))

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (10,784)