i used SHARED
the problem is that it doesn't write to the site files
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
It is not possible to directly write to a file on a server using the File component.
You will need to use the web component to download the file on the server, then edit it in your app, the use the web component again to upload the file back to the server.
I didn't know that at all,
so:
set web1 url to
call web1 get
when web1 got file
I put the file in a list and change it as I like
call web1 put file
Am I right?
Something like this will handle your download and then upload:
You will need a php file on your server to upload the file (SEE HERE for a simple example that should work on your server)
I don't know how to thank you.
I'm closing for today, my eyes can't take it anymore.
I've worked on computers for 50 years and I can't stop.
Is there anyone who has a free site and can read or write files via the app? I've tried everything but it always gives a write or read error. I've also tried entering the user and password, php files with variable passages, etc., but it always responds with a write or read error.
Did you read the post where I provided blocks and a suitable php file for upload/download of files ?
Did you try it ?
Also, if you upload the engkio4twdb.php
file to your website root we can have a look at getting this working as well.
This is the path you will follow in your website control panel
`
I tried everything and I definitely ended up getting confused.
engkio4twdb.php` file
<?php // Juan Antonio Villalpando // https://kio4.com/appinventor/326A_crear_miniwebDB.htm $receive_post = $_SERVER["REQUEST_URI"]; $tag = $_POST[ 'tag' ]; $file = 'my_kio4twdb_v2.htm' ; if (!file_exists($file)) {$handle = fopen($file, 'w');} if (strpos($receive_post, 'storeavalue' )){ // If that tag already exists, delete it. $data = file($file); $add = fopen($file, "w" ); foreach($data as $line) { $fields = explode( ":" , $line); if ($fields[0] != $tag) { fputs($add, $line); } } fclose($add); $valueToSave = $_POST[ 'value' ]; $line = $tag. ":" .$valueToSave. ":\n" ; $add = fopen($file, 'a' ); // Add $line to the file fwrite($add, $line); } else { // GET THE VALUE OF THE TAG. // Search the file for the value corresponding to the requested tag. $add = fopen($file, 'r' ); $exists = "" ; while(!feof($add)){ $line = fgets($add); $fields = explode(":", $line); if ($fields[0] == $tag) { $value = $fields[1]; $exists = "yes" ; } } // Send the result. if ($exists == "yes" ){ // Send the obtained value. $result = array( "VALUE" , $tag, $value); } else { // Send "not_found" that tag. $result = array( "VALUE" , $tag, "not_found" ); } $jsonResult = json_encode($result); echo $jsonResult; } fclose($add); ?>
i tried use mioscar.php
<?php
$nomeurl = $_GET[nomeurl]
$nomefile = $_GET[nomefile]
// URL del file di testo da scaricare
$url = nomeurl & nomefile ;
// Scarica il file di testo
$content = file_get_contents($nomeurl & $nomefile);
?>
initialize global nome url https://user:password@ufo1.byethost14.com/mioscar.php?nomeurl ="ufo1.byethost14.com/" & nomefile ="mist.txt"
buttom1 error 908
buttom2 error 1104
And it asks me to authorize it through the app settings.
But the app's permissions are for audio and video, and there are none for reading and writing files.
but if you have some example with tinydb web........, maybe it works better than files .............
@TIMA12 I also tried what you posted, no results, I did thousands of tests but I can't get anything better than error 908 error 1101 error 1104
Suggest you get hold of the support people at byethost, maybe they can assist with getting your server working correctly.
ciao Gino
sono Gianni di Prato
mi sto infognando perche non riesco a trasferire dei files.txt tramite mit app ad un server gratuito che ho preso
loro mi dicono che non hanno messo restrizioni per i piccoli file ma io ho sempre messaggi di errore
ho visto che stai facendo cose che io forse riusciro' a fare fra secoli, e volevo sapere se avevi qualche esempio di trasferimento file al server, forse sono io che continuo a sbagliarie qualcosa ma non capisco cosa
(e tutte le volte che chiedo non ho mai una risposta chiara di quello che dovrei fare)
ti ringrazio anche nel caso non trovassi tempo da dedicarmi
That is a little unfair.
Maybe
"Put as much effort into your questions as you'd expect someone to give in their answers"
You have often given us very little to go on, and it is often not obvious that you have followed the advice given. Also, most of your issues appear to be outside of the remit of this community - the configuration of your online server, so you are lucky we are still trying to help you through it.
I can see your webpage is up, and it is possible to download the T1.apk from the page. This tells us that some of the basics are working.
Show what you have tried to upload and download a text file from your web site using AppInventor, show your blocks and your methods on the server - e.g. php files. If it doesn't work show the error messages that are returned. We can then, with you, debug the process and hopefully find a solution. Try something simple first, then build up to what it is you actually want to do.
I just wanted a clear example of what I needed to do to transfer a file to or from the server, since they told me they didn't place any restrictions. But with all the examples you've given me, it keeps giving me errors 908, 1101, or 1104.
I thank everyone for their collaboration, but apparently no one has ever worked on a text file on the server, or at least those who have aren't willing to give me a clear example.
Years ago, I worked on machine language, PHP, HTML, Visual Basic, and other programs, and I've never had problems like this one, which is supposed to be intended for children due to its "ease."
But it seems to have a lot of problems, even though I recognize that you've done an exceptional job.
Or maybe the problem is that at 70, I can't figure out what exactly I'm supposed to do.
Your clear example is here on post #26
It looks like you ignored it
To say something like this does not help us to help you
See also these recommendations to learn
Taifun
@Taifun
I didn't ignore what you posted. I also tried all the examples you posted, but maybe it's the server (even though they told me they didn't put any restrictions on it, and I don't know how much I believe them) that doesn't allow you to transfer files, let alone text files, but only manually with the file manager.
But you do not show us what you tried, blocks, settings, php files, error messages from server etc.
If there is an issue with php, then again you should take this up with the provider.
Try some simple php examples through your computer browser see if that works, perhaps the provider is expecting a specific user-agent (e.g. not an android) to be presented in the headers?