web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Uploaded images are small
Power Apps
Answered

Uploaded images are small

(0) ShareShare
ReportReport
Posted on by 239

In this app the user uploads a copy of their receipt to be reimbursed. While it works the files when opened are very small and blurry. 

 

Any idea on how I can fix this? 

I have attached what it looks like after upload and the one that was uploaded. 

 

Here is the code for the Patch: 

Patch(
 'Travel Reimbursements',
 Defaults('Travel Reimbursements'),
 {
 TravelID: TravelSelection,
 'Exp Transaction Date': DateValue(HotelDate.SelectedDate),
 'Exp Category': "Hotel",
 'Exp Description': Text(TextInputItem),
 'Exp Cost': Value(TextInputCost.Text),
 'Exp Hotel Cost': Value(TextInputCost.Text),
 Name: "test"
 }
);


Set(varAttachmentControl_1, JSON(Image3_1.Image, JSONFormat.IncludeBinaryData)); 
Set(varBase64Only_1, Mid(varAttachmentControl_1, Find(",",varAttachmentControl_1)+1, Len(varAttachmentControl_1) - Find(",",varAttachmentControl_1) -1 ) );
TRUploadFile.Run("/Shared Documents/Travel Reimbursements/"&TravelSelection&"/",Text(varExpenseType)&"-"&Last(AttachmentControlAddDoc_1.Attachments).Name,varBase64Only_1);
Reset(AttachmentControlAddDoc_1); Set(varAttachmentControl_1,Blank()); 
Set(varAttachVisible,0); Reset(AttachmentControlAddDoc_1);
Set(
 varHotelPop,
 0
);
//Set(varAttachedFile,0); Set(varAttachedFileDoc,0);
//SharePointUpload.Run(GalleryEventList.Selected.'Event Key', Last(AttachmentControlCamera.Attachments).Name, varBase64Only);

 

 

Receipt-Testing.png
Hotel-Receipt-Testing-UPLOAD.png
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,727 Most Valuable Professional on at

    Hi @gfeldhake ,

    Firstly, I will give you some condensing of the code below, but that would not explain the issue

    Patch(
     'Travel Reimbursements',
     Defaults('Travel Reimbursements'),
     {
     TravelID: TravelSelection,
     'Exp Transaction Date': DateValue(HotelDate.SelectedDate),
     'Exp Category': "Hotel",
     'Exp Description': Text(TextInputItem),
     'Exp Cost': Value(TextInputCost.Text),
     'Exp Hotel Cost': Value(TextInputCost.Text),
     Name: "test"
     }
    );
    With(
     {
     wJSON: 
     With(
     {
     wJSONI: 
     JSON(
     Image3_1.Image.Image,
     JSONFormat.IncludeBinaryData
     )
     },
     Mid(
     wJSONI,
     Find(
     ",",
     wJSONI
     ) + 1,
     Len(wJSONI) - 
     Find(
     ",",
     wJSONI
     ) - 1
     )
     )
     },
     TRUploadFile.Run(
     "/Shared Documents/Travel Reimbursements/" & TravelSelection & "/",
     Text(varExpenseType) & "-" & Last(AttachmentControlAddDoc_1.Attachments).Name,
     wJSON
     )
    );
    Reset(AttachmentControlAddDoc_1); 
    Set(varAttachmentControl_1,Blank()); 
    Set(varAttachVisible,0); 
    Reset(AttachmentControlAddDoc_1);
    Set(varHotelPop,0);

    There are two things here - you have not posted your Flow, but I assume you are using base64ToBinary on the JSON you export and then using this as the Content of the image you are filing in the Library. The most important item however, bearing in mind your problem, is how you are generating Image3_1 - can you please explain the process for that.

  • GF-02121351-0 Profile Picture
    239 on at

    I unfortunately was not the person who wrote the code for the upload button; I have reached out to the person who worked on it and when I hear back will post their reasoning. 

     

    Sorry about that, I was assuming the issue would be on the app side. Here is the flow. 

    File upload Flow.png

  • WarrenBelz Profile Picture
    153,727 Most Valuable Professional on at

    @gfeldhake ,

    Yes, you are (as I expected) using base64ToBinary to convert and store the file, so I do not believe that is the issue. All that remains is the source of the Image and how that is derived.

  • GF-02121351-0 Profile Picture
    239 on at

    @WarrenBelz

    For testing I went to Google downloaded the sample that I attached to the original post and used the app to upload the image in the three spots. I put a different image in the folder (not through the app) and tried the flow and it returned the image true to size and not distorted. 

     

    How would you recommend I set up the image upload? 

     

  • WarrenBelz Profile Picture
    153,727 Most Valuable Professional on at

    @gfeldhake ,

    I need the code / process you are using to save the image - I cannot see your app, so do not know how you are creating it.

  • GF-02121351-0 Profile Picture
    239 on at

    @WarrenBelz

    I have uploaded everything that I can find related to this process. Do you have any tips for scraping the current setup and starting over? 

  • WarrenBelz Profile Picture
    153,727 Most Valuable Professional on at

    @gfeldhake ,

    Do you have screenshots of the process ? 

  • GF-02121351-0 Profile Picture
    239 on at

    @WarrenBelz 

    Here are screenshots from the app: 

     

    When they are ready to add their expenses, they select their category: 

    Screenshot 2023-02-13 160511.png

    Then Fill in the details for the expense: 

    Screenshot 2023-02-13 160540.png

    Click "receipt upload" and their documents folder opens where they select the file to upload:

    Screenshot 2023-02-13 160706.png

  • WarrenBelz Profile Picture
    153,727 Most Valuable Professional on at

    @gfeldhake ,'

    What is the code OnSelect of that button (in Text please)

  • GF-02121351-0 Profile Picture
    239 on at

    Hi @WarrenBelz 

     

    There is no code on the OnSelect for the Receipt upload button. There is an AttachmentControlAddDoc_1 shape over the button but it doesn't have any code either. 

     

    I figured out what Image 3-1 is, it is the image preview when a file is uploaded. Under Image the code is: 

    Last(AttachmentControlAddDoc_1.Attachments).Value

     

    I am beginning to wonder if I am patching the thumbnail and that is why it is so small.

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 321 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 289 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 200 Super User 2026 Season 1

Last 30 days Overall leaderboard