Web Addon Extension


#1

Hello everyone

I share this extension to download files and save to internal memory with a single method.

can read information as it works internally in the following link https://puravidaapps.com/filedownload.php

the code of the methods is the following

@SimpleFunction(description = "")
public void DownloadDrive(Web web, String path , YailList nameList, YailList codeDrive, int item  ){

	String url = "https://drive.google.com/uc?export=download&id=";

	String nameString = YailList.YailListElementToString(nameList.get(item));
	String codeString = YailList.YailListElementToString(codeDrive.get(item));

	web.SaveResponse(true);
	web.ResponseFileName( path + nameString ); 
	web.Url(url + codeString);
	web.Get();

}

@SimpleFunction(description = "")
public void DownloadImageUrl(Web web, String path , YailList nameList, YailList urllist, int item  ){

String url = "";

	String nameString = YailList.YailListElementToString(nameList.get(item));
	String codeString = YailList.YailListElementToString(urllist.get(item));

	web.SaveResponse(true);
	web.ResponseFileName( path + nameString ); 
	web.Url(url + codeString);
	web.Get();


}


 @SimpleFunction(description = "")
 public void DownloadImageDropbox(Web web, String path , YailList nameList, YailList codes, int item  ){


	String nameString = YailList.YailListElementToString(nameList.get(item));
	String codeString = YailList.YailListElementToString(codes.get(item));
	
	String url = "https://www.dropbox.com/s/"+  codeString + "/" + nameString +"?dl=1";

	web.SaveResponse(true);
	web.ResponseFileName(path + nameString ); 
	web.Url(url);
	web.Get();


}

Link source code complete

You can have more information and download links in the following link

Saludos

Andres Cotes


Is appybuilder offline version unlimited app size