Mit ai2 read file from downloads folder

Mit ai2 read file from downloads folder

mit ai2 read file from downloads folder

Query Any Google Sheet with a Web App · Download Multiple files from Multiple Folders on Google Drive · Get or Download a Private Image from Google Drive. How to download files from Google drive using download component? How to get file list from a specific folder. How to rename a file,s format. A. I can read a file from AppInventor/data folder (in Internal storage). I can't read In my AI2 app, I would like to read only any newly arrived data. Firebase storage download working for few android version but not working for.

Mit ai2 read file from downloads folder - delightful

Mit ai2 read file from downloads folder - are

That: Mit ai2 read file from downloads folder

Cue software version stuck downloading 129
Download youtube video to my pc 460
Fonemonitor free download 215
How to download a steam mod without installing 441

Upload Any File To Google Drive with AI2

With many thanks to Juan Antonio, who developed THIS extension, we are now able to upload any file (as far as I have tested)

to Google Drive from within AI2, using base64 encoding and a simple google web app.

I have prepared a simple example to demonstrate how this is done, and can be used as a base to replace the HOWTOs I have done

for uploading files and OCR for images and PDFs using Google Drive and Docs.

I recommend you keep original upload file sizes below 5mb

Tested on the following file types so far: 3gp,csv,gif,htm,html,jpeg,jpg,mp3,mp4,pdf,png,svg,txt,wav,webm,zip (see UPDATE2 below regarding aia & aix files)

The workflow:

  1. Get the file and its path and filename from either assets or the virtual sdcard

  2. Get the mimetype of the file using blocks from the extension

  3. Convert the file to a base64 encoded string

  4. Send these three things: filename, mimetype and encoded string to the web app

  5. The web app decodes the encoded string, and saves the file with the supplied filename, and with the correct mimetype to your folder specified in the web app

  6. The web app then returns a “success” message, if successful.

function doPost(e) {

var data = Utilities.base64Decode(e.parameters.data);

var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);

DriveApp.getFolderById('<YOUR FOLDER ID HERE>').createFile(blob);

return ContentService.createTextOutput("Your File Successfully Uploaded");

}

If you want the file ID of the uploaded file returned to the app, then use this script instead: (you will need to amend the workings of the Web1.GotText blocks accordingly)

function doPost(e) {

var data = Utilities.base64Decode(e.parameters.data);

var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);

var fileID = DriveApp.getFolderById('<YOUR FOLDER ID HERE>').createFile(blob).getId();

return ContentService.createTextOutput(fileID);

}

Remember to publish and create a new version each time you change something in the script. The script should run as the owner of the google account, and be accessible to “anyone,even anonymous”

Get the URL to the web app script when you publish, to use in your blocks

uploadGD.webm

Many thanks again to Juan, none of this would be possible without your fine efforts 🙂

On request from another user on the forum, I developed a further demo that provides a file picker (targeting the sdcard). This required Taifun's File Extension, so credits to Taifun for this. The demo will return a set of directories under /storage/emulated/0 and then after selection of a directory, return all the files in that directory for selection. The file path is then setup for use with the base64 extension. Tested in companion for Android 9 and 10

UAFTGD_with_FILEPICKER.aia

With that to user SG_Production on the AI2 forum, it has become apparent that files with the extension aia or aix do not provide a valid mimetype in the app, causing the demo app to error. To overcome this an additional check is required when setting the mimetype if uploading these files. There may also be other files types where the default finding of mimetype does not work.

If you need any help and support with AppInventor then in the first instance join up at the MIT AppInventor forum (provide a link back to any page here if relevant)or you can contact me directly via the Contact page
Источник: [https://torrent-igruha.org/3551-portal.html]
mit ai2 read file from downloads folder

Mit ai2 read file from downloads folder

3 thoughts to “Mit ai2 read file from downloads folder”

Leave a Reply

Your email address will not be published. Required fields are marked *