Hello community, I have created a download button and pdf viewer, I want the following function:
When the button is clicked, I want to check in the mobile directory if the file “namefile.pdf” is stored in it; If it is stored there will be the file, otherwise, download the file and then display it.
Use any of the following extension:
you might want to replace the old version by the newest version manually like this:
export your project (aia file)
unzip the extension, this creates the directory com.puravidaapps.TaifunFile
open the project (aia file) using 7zip
go to the subfolder /assets/external_comps and delete the subdirectory com.puravidaapps.TaifunFile
move the previously unpacked extension directory com.puravidaapps.TaifunFile to its correct path in the aia file of the app
upload the modified project into Kodular
Once again I am here to present my second extension to community.
Probably you have read in title , the name of extension is FileTools and features are similar to its name.
It provides tools to work with Files (folders also).
Latest Version: 2
Last Updated: 2019-10-01T18:30:00Z
A wide range of blocks…
It has total 32(can be less or more) blocks
As it has ‘s…
:point_up:As you know, it is possible with the shell component to get the modified date
However sometimes a directory contains a lot of files and the ls -l command crashes from about more than 600-700 files. I wanted something which has no crashes or lags so I wrote this very simple extension:
It is a faster and better solution to get modified date.
Blocks what you can use:
[Download at the end of post!]
How to use extension:
Here is an example (remember that it wo…
Set the Load From Storage block on When Download Complete event
And with file extension If File/Directory Exists
Edit: My mistake! the first block should also check, right?
@samidr8, I believe now it’s clearer.
@Fabio, Thank you very much my brother, The Eternal bless you.
There is no need to check file on download complete.
According to your blocks,
Download will only start if file doesn’t exists.
Why? Maybe internet is disconnected and extension thought download has finished, or maybe it downloaded corrupted file.
create a procedure for checking file and downloading if it does not exists
run procedure on screen initialization
if download failed run procedure again
…this will create a loop until file gets downloaded.
Use network component and if network disconnected then pause download.
As I know there is an event block named ’ download error’ (I am very good in forgetting names
) that will be triggered if download failes or comes an error
That was the simplest way to explain. Surely, he can leave out the check file block, and also add notifier, such as “Open PDF now? Yes No”, “Download Complete”, and so on
Yes there are multiple ways to do a particular thing.
Now it depends on @samidr8
Thank you very much for your contributions to all, sincerely I had not contemplated if a cell phone had no internet connection. The suggestions will be put into practice.
One last question, by default, is the Custom_Download component where you save the downloaded files?
In my case, it does it in the mobile memory, because I don’t have an SD card, and in the case that an expandable SD memory?
In my case I use the Application Specific Directory in the internal storage, but it can be also used in the external storage. In both cases, it’s not necessary to ask for permission.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.