cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fuadaj
Frequent Visitor

Not able to open attachments which were uploaded using power automate. Says, the file is corrupt

Hi,

I have a flow to upload attachments to a list. However when I try to open the file it does not open and says the file is corrupt. When I upload the same file directly to the list, it opens up fine. 

When I check the list, the file name is correct which includes the file extension. Any suggestions?

2 ACCEPTED SOLUTIONS

Accepted Solutions
DamoBird365
Community Champion
Community Champion

Hi @Fuadaj 

 

As a test, have you uploaded the file to a document library - this would be to rule out problems with your list.   Where does your attachment contents come from?  Have you double checked that the dynamic expression you have used is indeed the content expression you are looking for?  Maybe you have selected something that isn't the content of the file. 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

DamoBird365
Community Champion
Community Champion

Hi @Fuadaj 

 

The file content is actually the encoded file content.  If you were to open a word document in a plain text reader like notepad or notepad+ you would see a big messy string of data.  You need to capture that from somewhere.  So if it isn't being returned as a dynamic value from get form response, you would have to use a get file action and then put the contents from the get file into your add attachment.  

 

The file name can either be the original name or if you want to be unique about it, you could append a formatdatetime(utcnow(),'yyyy-MM-ddhhmmss')[originalfilename] or you migh have problems later when folk upload a file with the same name.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

3 REPLIES 3
DamoBird365
Community Champion
Community Champion

Hi @Fuadaj 

 

As a test, have you uploaded the file to a document library - this would be to rule out problems with your list.   Where does your attachment contents come from?  Have you double checked that the dynamic expression you have used is indeed the content expression you are looking for?  Maybe you have selected something that isn't the content of the file. 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

Thank you @DamoBird365 for your quick response. I guess you are right in saying, the file content is not being selected. Btw, we did upload the file onto the list manually and that opens up the attachment.

 

Fuadaj_0-1616320520095.pngFuadaj_1-1616320569021.png

This is what I have. I guess the file content being uploaded is just the file name? Not too sure though, because it does show the attachment in the list. 

We get the attachment from a form. As far as I understood, the form attachment are being saved the documents folder of the TEAM where the form was created.

Any tips on how to go forward from here?

DamoBird365
Community Champion
Community Champion

Hi @Fuadaj 

 

The file content is actually the encoded file content.  If you were to open a word document in a plain text reader like notepad or notepad+ you would see a big messy string of data.  You need to capture that from somewhere.  So if it isn't being returned as a dynamic value from get form response, you would have to use a get file action and then put the contents from the get file into your add attachment.  

 

The file name can either be the original name or if you want to be unique about it, you could append a formatdatetime(utcnow(),'yyyy-MM-ddhhmmss')[originalfilename] or you migh have problems later when folk upload a file with the same name.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (25,628)