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
Super User
Super User

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

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
Super User
Super User

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?

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,800)