Pick Files and Upload to Google Drive

Hello Everyone ,

I'm looking for a Developer who can make either extension or a way to upload any file to either google drive or any hosting space.

the example he will provide must work , and NO FTP shall be used nor Airtables

If someone already made this he can share his apk to test it and then his AIA file or AIX to buy it.

Did you look here?

https://puravidaapps.com/extensions.php

Hi Peter ,

I searched and tried plenty of examples but non worked , So I need to stop hassling myself and pay for something that works.

Everyone on here, and on Kodular, has already told you that you do not need an extension for this, everything is possible with blocks. You say that everything you have tried does not work, but you have not submitted your blocks/code to the forum in order to find out why. They work for others, so why not for you?

Once again:

POSTing a file to a php server

Upload Any File To Google Drive with AI2

Follow the guides, try them out if aia projects are provided, then come back if you can't get either to work, showing your blocks and code.

Also

HOWTO: Create a Google Apps Script Web App bound to a Spreadsheet
may help..

I will share aia file now.

GDRIVE_AMMAR.aia (207.7 KB)

The main problem is after picking up the file it doesn't upload it , it upload zero byte file.

this is the aia file for it

antarees(1).aia (448.4 KB)

this one is for file upload via php and below is the php script

<?php

set_time_limit(0);

$cv= $_POST['cv'];
$cvext = $_POST['cvext'];

#$cvdata = $cv;

$cvdata = base64_decode(str_replace(array('-', '_',' ','\n'), array('+', '/','+',' '), $cv));

$cvfile = fopen("test/".$cvext, "wb") or die("Unable to open file!");

fwrite($cvfile, $cvdata);
fclose($cvfile);

 $cvpath = fopen("test/cvfile.txt", "w") or die("Unable to open file!");
 
fwrite($cvpath, 'test/'.$cvext);

fclose($cvpath);


echo $cvext;

?>

Actually that's what annoyed me and I lost more than 5 days on it and that's the reason why I want it be fixed for money and hassle free.

Please try the two examples again from the beginning, without any modifications, once we have those working you can add the things you want, and keep testing as you do that.

Remember, with a web app:

1 Open the script project
2 Go to Publish
3 Deploy as Web App
4 Project version: - select New from the dropdown
5 Execute the app as: your google account address (email)
6 Who has access to the app: Anyone, even anonymous
7 Press the Update button

You have to do this EVERY TIME you change your script

2 Likes

I tried them regarding the GDrive it uploads only images but the problem isn't the images it's the file picker which is most important

did u try it and got it work so far till now or not , with all these android api versions updates ???

You can confirm that you are able to use the Upload to Google Drive demo to upload the image file provided ?

The issue now is picking a different file for upload ? Yes there are a few problems arising following the latest update, especially for Android 10+ devices, due to Google's tightening of file access policies. There is a bugfix release due soon, it is in testing at the moment. there are several topics on the forum about getting the correct file path, I have not seen a definitive solution yet for all situations, all android versions, but i am sure this will be forthcoming shortly. What is you android version of your device? We can then seek a solution from there....

Have you tried the php post file solution on your server yet ?

I can confirm it upload only image files but any other extension not at all that's why I'm posting this and I need help in it.

the point is did you test it on your side and it worked with you or not to upload any file extension if so then please share otherwise we need to wait for a solution of this unsolved problem

The demo app is setup to handle any file type (those i have tested I know work). The script will work with any file type.

I have just retested the demo app with a txt and a zip file, these worked OK.

What are you trying to upload, how big is it (hopefully less than 5mb) and what are you changing in the app ?

1 Like

I don't think it will exceed more than 5 mb but maybe there are some files will be more , can you share the aia file please ?

It is the same one as you will have downloaded from my web page ? (linked above)

All I did was add new files to the assets and change the name of the file to be uploaded

oh I don't mean in the assets , I mean as file picker or stored in the phone where I can choose a file already.

Doesn't matter where the file is. It is just a demo app, so I only changed the bare minimum to test.
You asked if it could upload files other than images, which it can.

regarding the embedded assets already inside the project sure it can , but that's not my point at all I mean when I pick another file such as from the SD card or from the phone memory not embedded
[ file:// ]

That is a different issue. You will need to check that the file path returned for the file that you pick meets the requirements of the blocks for the uploading section. You may get a content uri which needs converting, or if on Android 10 a "wrong" file path that needs correcting, or you may need to extract the filename from the file path returned. Use Do It on your blocks once you have picked a file to see what you are getting back.

Remember, in the demo the files are in the assets - there is no file path - per se... (<Android 10)

I wasted more than 6 days so far on this that's why I said enough of it and pay to let someone else do it for me , because I can't keep suffering in anything in my life like this.