Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

"Create File" file type?? Help!

Posted on by 10

I have a flow where I am creating a new folder, and then uploading images to that folder. 


It is all working well, except for the files are being uploaded as a random file type that can not be openned or read!  I have tried uploading .png, .jpeg, .xlsx, .doc, but they all just are uploaded as this generic "file" type that does nothing!


Do I need to format the file a specific way after it is uploaded?  Or convert file?  Or file properties?  I've tried a bunch of things but can not get it to work. 

sc1.PNG

sc2.PNG

Please help!

  • Suggested answer
    ML-21112302-0 Profile Picture
    ML-21112302-0 2 on at
    "Create File" file type?? Help!
    I think I got it!
     
    I just resolved this issue on my flow by adjusting the file name. Apparently the program looks to the suffix of the file name to identify the file type so you need to make sure to include the right suffix (i.e. .png or .jpg). To do this dynamically you can pass the file name directly from Power Apps.
     
    So, in the "File Name" field you will want to create an expression that says this... 
     
    triggerBody()['file]['name]
     
    Then the complete name, including the file type, will be passed through and should open correctly. 
  • PVATom Profile Picture
    PVATom 9 on at
    Re: "Create File" file type?? Help!

    This is true.  Now I go to try to find out what kind of file it creates.  Likely some kind of binary.

  • Jason-E Profile Picture
    Jason-E 35 on at
    Re: "Create File" file type?? Help!

    It seems to me, that the setting of a file extension does not result in the file content being converted to said content.

    So if you place HTML content or Word content, and give it an extension of .pdf, you get a file with .pdf extension, but you do not get a file that is encoded as a PDF, thus when you try to open it, you get an error. Same with the JPG.

    In fact, I suspect if you passed it text and told it to save it as a .jpg, then tried opening the created file, it would fail. But if you re-name the file to .txt, and try opening it again, it will open in a text editor with the original text content.

  • Pstork1 Profile Picture
    Pstork1 63,890 on at
    Re: "Create File" file type?? Help!

    Your flow shows you using Ask In Power Apps to supply the file content.  But your run() command in Power Apps is just passing the filename of the file to the flow.  If you look at what is actually being passed you will see that it starts with something like 'APPRES:\\'.  Files uploaded into an image in Power Apps are actually cached in the browser and the cache is what is displayed.  That makes the contents of the file unavailable without extra processing.  Take a look at the following walkthrough.

    Upload Image to SharePoint list through PowerApps. | MOURI Tech

  • cmitch Profile Picture
    cmitch 10 on at
    Re: "Create File" file type?? Help!

    @CFernandes thanks for the comment.  I am still getting the same error though.  See pictures:

     

     

    cmitch_1-1619808902460.png

     

    cmitch_0-1619808867625.png

     

    Any other advice? 

     

    cmitch_2-1619808942805.png

     

  • CFernandes Profile Picture
    CFernandes 8,019 on at
    Re: "Create File" file type?? Help!

    Hey Mate, 

     

    In the Run() you will need to return the Filename to Power Automate.

     

    The Formula to get the fileName would be 

     

    AddMediaButton1.FileName

     

    CFernandes_0-1619804964474.png

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • cmitch Profile Picture
    cmitch 10 on at
    Re: "Create File" file type?? Help!

    Answer to that question is in the screenshots of my last message^

     

    Adding the picture via the "tap or click to add a picture" media add button.  

  • Pstork1 Profile Picture
    Pstork1 63,890 on at
    Re: "Create File" file type?? Help!

    I assume you are uploading the file in Power Apps since you are passing the contents as a parameter.  How are you generating the contents to pass to the flow?

  • cmitch Profile Picture
    cmitch 10 on at
    Re: "Create File" file type?? Help!

    @Pstork1 

    This is driving me nuts.  Everything appears to be set up correctly; a file is being uploaded; I just can't view the picture when it finally is!! 😫

    cmitch_2-1619792175343.png

     

    cmitch_1-1619792156184.png

    cmitch_3-1619792204150.png

    cmitch_4-1619792216872.png

     

     

  • cmitch Profile Picture
    cmitch 10 on at
    Re: "Create File" file type?? Help!

    @Pstork1 

    Yes I have been trying to open it on a regular browser (chrome) on my desktop in Sharepoint.  I am attempting to upload the picture via iPhone, and then have it be available to view via Deskstop Sharepoint.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard