# Export file in cordova app not working

**URL:** <https://forum.radsystems.io/t/export-file-in-cordova-app-not-working/1404>\
**Category:** Issues\
**Created:** [February 14, 2023, 2:18am UTC](https://forum.radsystems.io/t/export-file-in-cordova-app-not-working/1404 "2023-02-14T02:18:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goto](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@Goto](https://forum.radsystems.io/u/Goto)\
**Post date:** [February 14, 2023, 2:18am UTC](https://forum.radsystems.io/t/export-file-in-cordova-app-not-working/1404/1 "2023-02-14T02:18:47Z")

</div>

My export (Print) file is not downloading any file on my Cordova-generated android app. But everything works fine on the spa from both mobile and desktop browsers.

On the android app, I can see the action red line fully loading on top but nothing appears as downloaded. Please assist.

I have added the following into my config.xml and AndroidManifest.xml but still can’t see any file.

```auto
<preference name="AndroidPersistentFileLocation" value="Download" /> 
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,download,root" />

```

```auto
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />

```

---

<div class="post-metadata">

**Author:** ![willvin](https://forum.radsystems.io/user_avatar/forum.radsystems.io/willvin/32/7_2.png) [@willvin](https://forum.radsystems.io/u/willvin)\
**Post date:** [February 14, 2023, 2:47pm UTC](https://forum.radsystems.io/t/export-file-in-cordova-app-not-working/1404/2 "2023-02-14T14:47:26Z")

</div>

Try following the instructions here [[Solved] [V1] Download a file in Cordova app | Quasar Framework Community (quasar-framework.org)](https://forum.quasar-framework.org/topic/3375/solved-v1-download-a-file-in-cordova-app) and see if it helps. Below you’ll find the file you have to modify to apply the instructions from the quasar forum.

The export code is located on **line 100** of **project root/frontend/src/composables/app.js** , but the main code is located on **line 119** :

```auto
	function exportPageRecords (pageExportFormats, currentPageUrl, pageName) {
		let actions = [];
		pageExportFormats.forEach(format => {
			actions.push(menus.exportFormats[format]);
		});

		let message = $t('export');
		$q.bottomSheet({
			message,
			grid: false,
			actions
		}).onOk(action => {
			let selectedExport = menus.exportFormats[action.id];
			let queryParam = {
				export: action.id
			}
			let exportUrl = utils.setApiPath(currentPageUrl, queryParam);
			let fileName = `${utils.dateNow()}-${pageName}.${selectedExport.ext}`;
			$q.loading.show();
			ApiService.download(exportUrl).then((response) => {
				const url = window.URL.createObjectURL(new Blob([response.data]));
				const link = document.createElement('a');
				link.href = url;
				link.setAttribute('download', fileName);
				document.body.appendChild(link);
				link.click();
				link.remove();
				$q.loading.hide();
			},
			(error) => {
				$q.loading.hide();
				console.error(error);
				alert("Unable to download file")
			});
		}).onCancel(() => {
			// console.log('Dismissed')
		}).onDismiss(() => {
			// console.log('I am triggered on both OK and Cancel')
		})
	}

```
