Skip to content

Commit

Permalink
Merge pull request #3005 from LiteFarmOrg/LF-3878-Downloaded-document…
Browse files Browse the repository at this point in the history
…s-with-an-unrecognized-format

LF-3878 attempt at fixing file extensions with underscore
  • Loading branch information
kathyavini authored Nov 20, 2023
2 parents 609100a + 957dfda commit 93abc8c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mediaEnum } from './constants';
import { ReactComponent as Download } from '../../assets/images/farmMapFilter/Download.svg';
import useMediaWithAuthentication from '../hooks/useMediaWithAuthentication';
import { mediaEnum } from './constants';

export function MediaWithAuthentication({
fileUrls = [],
Expand All @@ -19,7 +19,7 @@ export function MediaWithAuthentication({
const handleClick = () => {
const element = document.createElement('a');
element.href = mediaUrl;
element.download = `${title}.${extensionName}`;
element.download = title;
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
Expand All @@ -28,7 +28,7 @@ export function MediaWithAuthentication({
const handleZipDownload = () => {
const element = document.createElement('a');
element.href = `data:application/zip;base64,${zipContent}`;
element.download = `${title}.zip`;
element.download = title;
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
Expand Down

0 comments on commit 93abc8c

Please sign in to comment.