[HOLD for payment 2021-09-16] Remove the download attachment button in the upload attachment preview modal
If you havenβt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Run Web, Mobile Web, or Desktop version.
- Open any Chat
- Click + (Actions) button, Click Add Attachment
- Choose Image or any document to upload.
- Click Download button at top right in Send attachment modal.
Expected Result:
Should download file with original file name and extension. or There should not be an download attachment button if the file has not been uploaded yet.
Actual Result:
Downloading file with long file name without extension.
Workaround:
N/A.
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.0.93-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Upwork job URL: https://www.upwork.com/jobs/~01c46bee71798ea0e6
From @PrashantMangukiya https://expensify.slack.com/archives/C01GTK53T8Q/p1630508588269200
Download via Send attachment modal does not save file extension.
Triggered auto assignment to @tgolen (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Let's remove that button when you're previewing what is about to be uploaded. It doesn't make sense to have it shown.
Proposal
We have to update code at line 136 within AttachmentModal.js file as shown under,
Code before update (line 136 AttachmentModal.js): https://github.com/Expensify/App/blob/01748665595da12e56ec2428f78547e018f32f24/src/components/AttachmentModal.js#L131-L139
Code after update (line 136 AttachmentModal.js):
<HeaderWithCloseButton
title={this.props.isUploadingAttachment
? this.props.translate('reportActionCompose.sendAttachment')
: this.props.translate('common.attachment')}
shouldShowBorderBottom
shouldShowDownloadButton={!this.props.isUploadingAttachment} // Condition added here
onDownloadButtonPress={() => fileDownload(sourceURL)}
onCloseButtonPress={() => this.setState({isModalOpen: false})}
/>
As shown above we have to add condition at line 136, so it will not show download button for uploading attachment, but if someone view attachment it will show download button.
Here is screen recording for web version. i.e. How it works once code updated. Similar behaviour will be there for other platform also.
https://user-images.githubusercontent.com/7823358/132067024-1c5f2fef-5b74-4658-aec8-183d17efd035.mov
If my solution considered the kindly invite me on Upwork once project posted. So I will do testing for other platform and submit pull request thereafter. Here is my Upwork profile: https://www.upwork.com/freelancers/~01c718889ed7821f82
Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Oops, I meant to label this as external earlier. @parasharrajat Wouldn't that remove the button completely? We still want it there when someone is viewing an attachment.
Hi @tgolen, Good catch. You are right, let me figure out solution so download button will be removed during send attachment (i.e. during file upload) time only and available when someone view the attachment. Thanks.
Hi @tgolen. I updated my proposal, now it will show download button when someone view the attachment, but not during attachment upload time. Here is my updated proposal. https://github.com/Expensify/App/issues/5066#issuecomment-912801001 Thanks.
Cool, I think that's solid now. Thanks! @trjExpensify I will let you take over from here, but the proposal has my π’ (please don't work on it yet @PrashantMangukiya )
Hi @tgolen, Thanks. Just to clarify that there is not any proposal yet from parasarrajat, did you mean green signal to my proposal? my github id is @PrashantMangukiya as I posted proposal above.
Sorry, yes. My bad! I'll edit my post
Updated the issue title to be a tad more reflective of the scope here. Upwork job can be found here, @PrashantMangukiya I've invited you to the job for ease, so feel free to apply and we'll then assign this issue to you. Thanks!
Hi @trjExpensify, Thank you for the invitation. I applied for the job. Kindly assign me.
Yup, sent you the offer. Once accepted, I'll assign it over to you. π
@trjExpensify, Just accepted. Thank you.
Hi, @trjExpensify Pull request #5101 submitted and ready for review.
:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.
π Deployed to staging by @tgolen in version: 1.0.94-2 π
| platform | result |
|---|---|
| π€ android π€ | success β |
| π₯ desktop π₯ | success β |
| π iOS π | success β |
| πΈ web πΈ | success β |
π Deployed to production by @yuwenmemon in version: 1.0.95-1 π
| platform | result |
|---|---|
| π€ android π€ | success β |
| π₯ desktop π₯ | success β |
| π iOS π | success β |
| πΈ web πΈ | success β |
Paid π
@trjExpensify Received thanks.