Post a file to your server in the Internet with a textfile

Thanks again.
How can I use the specific directory for my app?
With android 10 I cannot upload files from

/storage/emulated/0/Android/data/com.mendhak.gpslogger/files/`

kindly regards

Try giving write permission (also gives read permission)

These blocks work for me ( I copy the file first from assets to the ASD then upload)

Thanks for your answer.
Which extension do you use because in my extension of TaifunFile I don't have a call TaifunFile.ApplicationSpecificDirectory.
May you can send me the extension.
kindly regards

Oh sorry.
I think I use an old taifunfile.
I must download the new version and then I try it again.
kindly regards

Hi!
Thanks a lot for your help and patience with me.
It works now with the ApplicationSpecificDirectory.
kindly regards

Yay !! :+1:

Hi!
I have one more question.
When I do TaifunFile1.copyasync to the TaifunFile1.ApplicationSpecificDirectory I think this folder will grow up always when I do a copy.
How can delete all file in this ApplicationSpecificDirectory when I have done the upload.
kindly regards again

Hi!
I think I have used the wrong block.
I used first TaifunFile1.Copy -> there the files will copy also the file into the ApplicationSpecificDirectory.
With TaifunFile1.CopyAsync -> there will not copy the file into the ApplicationSpecificDirectory.
kindly regards

Both methods will copy files where you want to copy them, the async method helps with larger files and collections of files because it does not interupt the program flow. The async method also provides you with an afterCopying event which you can use when the entire copy function is complete.

Not sure why you want to delete the files you have just copied over ?

There is a File.Delete method in the File component (or in TaifunFile) which will allow you to delete files. A single slash / before the file name will provide the file path for files in the ASD

Hi!
I have one more problem.
Here my project:

The problem ist, when I have one than more files which the datum < aktdatum only one file will be delete with the function löschen.
Hope someone can help me there
kindly regards

Hi!
I check the code again.
The problem is when I have no internetconnection there will no file upload but the files will be deleted.
My idea is when I upload the file it should deleted on the phone.

When I deactivate the internet connection I will get Error1101 and Error1104.


How can I check this error so that no file will delete after I get this error.

kindly regards

You would like to check this:

Thanks for the answer.
I could add this network extension.
Here my complete project:

I noticed an further problem.
When I test it with some more files with the companion I will never get a problem or error.

But when I use the build apk I will get always an error with the first file in the listview.
Here my listview of three files:

When I start the app I will get this error:

The next files will update without any problem but not the first one.
I will search now the whole day for the error but couldn't find it.

Hope someone can help me there again.
kindly regards for any further answer.

Hi!
It seems that I will not work in my project.
Can you informe me where can I find the asstes folder?
How can I gives the read permission?
I will try your example.
I think I mus press first the button2 then button1?
kindly regards again for your help

the assets folder are the files you uploaded in the media section of the designer

usually you do not have to think about giving permission, this generally works automatically

übrigens, du darfst auch gerne hier in Deutsch schreiben... das macht es für dich eventuell etwas einfacher? Das Forum bietet eine Übersetzungsfunktionalität...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Ich habe eine App entwickelt, wo ich mehrere Dateien eines Ordners uploade.
Das funktioniert auch soweit.
Es kann aber vorkommen, dass während des uploads die Internetverbindung unterbrochen wird.
Dann erhalte ich Error 1104.


Ich habe auch versucht mit der Extension Net dies abzufangen, wenn keine Netzwerkverbindung vorhanden ist die App zu beenden.
Sobald ich aber diesen Error 1104 erhalte wird anscheinend kein Code von Appinventor durchgeführt.

Ich möchte, wenn dieser Error 1104 auftritt, dass die App geschlossen wird.
Hoffe es kann mir jemand weiterhelfen.
Vielen Dank für jede Antwort

please post a readable screenshot of your relevant blocks
did you try the Screen.ErrorOccurred event?

Taifun

Vielen Dank für die Antwort.
Der Block Screen ErrorOccured hat weitergeholfen.
Danke und lg