[Paid] File Picker Extension : Pick Any Type Of File From Storage

[Paid] File Picker Extension : Pick Any Type Of File From Storage

Very simple and easy way to pick file from storage. This extension works on all Android API level.


image

:green_square: Extension Properties

Set limit for caching files.


image
image


:purple_square: Pick Single File

Use this function to pick single file.


image


:yellow_square: Single File Picked

This event will be triggered when single file picked.


image

  • filePath --> Return type String.
  • fileUri --> Return type String.
  • mimeType --> Return type String.
  • fileName --> Return type String.
  • fileSize --> Return type Integer.
  • formattedSize --> Return type String.

:purple_square: Pick Multiple Files

Use this function to pick multiple files.


image


:yellow_square: MultipleFilesPicked

This event will be triggered when multiple files picked.


image

  • filePaths --> Return type List.
  • fileUris --> Return type List.
  • mimeTypes --> Return type List.
  • fileNames --> Return type List.
  • fileSizes --> Return type List.
  • formattedSizes --> Return type List.
  • totalFiles --> Return type Integer.

:yellow_square: Canceled

This event will be triggered when user canceled or back pressed.


image


:yellow_square: Failed

This event will be triggered when got any error.


image

  • errorMessage --> Return type String.

:yellow_square: Permission Result

This event will be triggered when got storage permission result.


image

  • isGranted --> Return type Boolean.

:purple_square: Clear Cache

Use this function to clear all cached files manually.


image


:receipt: Extension Specifications ↓


:star: Size: 36.5 KB
:coin: Price: $6 USD
:gear: Version: 2.0.0 (Latest)
:earth_americas: Released On: 07 July 2021 (GMT+6)
:earth_americas: Updated On: 21 May 2024 (GMT+6)
:credit_card: Payment methods: PayPal | Skrill | TransferWise (Wise) | Xoom | Airtm | Binance | Crypto | Pyypl | Card Payment | UPI (:india:) | JazzCash (:pakistan:) | Bkash (:bangladesh:)


13 Likes

Does this work for all android versions (e.g. Android 11) and will there be any impact when AppInventor targets API 30 ?

1 Like

Why did you remove your extension from Kodular?

Kodular removed it

Really nice extension @JEWEL, you have overtaken MIT App Inventor's Activity Starter GET_CONTENT!

after the SDK30 limitations the file picker extension might not work in all cases anymore to access arbitrary directories... see also the unanswered question by @TIMAI2

for this purpose the SAF extension might be used

Taifun

Perfect extension, add the obj files and applications as well :grin::+1:

2 Likes

Hi, it is possible pick file .csv ? like filepicker1.csvFile

1 Like

Yes, set All as file type

1 Like

I'm using the FilePicker extension by Jewel, and I give the option to pick a file and open it. However, whenever I choose a file, the app crashs. I'm using the companion to test it. Here's my code:



Note that I'm only using audio files to test, in the future you'll be able to open all supported file types.

1 Like

Use logcat to find out more

Taifun

1 Like

How do I do this with the companion app?

1 Like

exactly as it is described in that link...
start logcat, then elicit the issue in the companion app, after that stop logcat... you might want to copy the output into a textfile and add it here into this thread

Taifun

1 Like

Try this:

FileTools extension from @vknow360 → here and here.

Note:

  1. You cannot pick a file from a removable (micro) SDcard with this extension.
  2. You must request READ permission on Android 11+ and WRITE on Android < 11.

Note: There is a bug in this extension:
WRITE permission MUST be declared in the Manifest on Android 11+.

Otherwise you get this error message:

Permission error

As a workaround set → DefaultFileScope = Legacy (in the Designer).

FilePicker.aia (51.4 KB)

@JEWEL
@justaquestion

Hi Anke, I did as you described above with the work-around DefaukltFileScope in Designer = "Legacy" (and I even tried it out with your example aia), but I still get the message "Permission was not granted". On my Samsung with Android 12, SdkVersion = 31.
Any clue?
KR, Oli

Yes, WRITE permission must now also be requested on Android 11+ in order for the extension to work on Android 11+ devices, which of course makes no sense at all since WRITE permission no longer exists there.

Thx, Anke.
Does that bottomline mean, that uploading any file from e.g. /Documents/ or /Download/ is not at all possible if Android > 11+? Or is there any work-around possible (with e.g. other extensions)?
I only want to pick a simple txt file which I have edited in my smartphone and after picking, i want to upload it to a webspace with SFTP (which itself is no issue, just I cannot "grab" that file so far).

If you edited the text file on your phone (outside of your app), this text file is no longer created by your app itself. In this case you must use SAF to access it on Android 11+.

See also my guide "How to access media and non-media files on Android 11+" → here.

1 Like