Test php no result

`
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.

@Gino_Enzini

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.

1 Like

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

1 Like

@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?

Ticket ID952834 Updated at Aug 01 2025 15:12:09 (GMT)
Posta in arrivo

noreply@hostmessage.info
ven 1 ago, 17:12 (2 giorni fa)
a me

Your support ticket has been updated, please log into your support account (or control panel) where you created the ticket to see a full ticket log

-------------------------------byethost.com replied---------------------------
Hi there,

No, there are no limitations for such files. Please confirm the error you are experiencing so we can assist you further.

Please let us know if there is anything we can do.

Best Regards

See the great features, try a preview of iFastNet Premium cPanel here: https://ifastnet.com/demo

iFastNet - Proud winners of the TMT Telecom 2017 "Best Premium Hosting" award.

Premium hosting solutions available from https://ifastnet.com solid secure fast hosting !

@TIMA12
I'm so sorry, but from the statements you're making it seems to me that the one who hasn't read all the previous posts is you. If you keep saying that I didn't give the error codes, that I didn't send the .php files, that I didn't show the examples, I use Google Translate but it doesn't seem like I spoke Arabic.

@TIMA12
and in any case you are not entirely wrong, maybe I explained myself badly, I wanted some examples from those who have actually tested the file transfer, not tests that continuously give errors 908 1104 1101 etc.

And maybe the problem is Android 14.
For example, with files in the Documents folder.
If Filescope Share asks for permissions (which are always denied).
If Filescope Legacy or other apps say the file can't be found.

By the way, I tried to manually edit a file I have in Docs. I opened it with Google Sheets, edited it (Google Sheets seems to save it automatically because the word "saving" appears, and then I can't find the save option anywhere). I went to reopen it and found it exactly as it was before the edit. Yes, I really think it's Android 14 that's having problems.

image
And even with these two blocks, it doesn't give any results, nor any errors.
If I set mfile1 to legacy (the only option, and on Android 14, it seems that legacy isn't valid), it tells me to set the app for permissions (the program denies permissions, and in the app settings, there's no option to authorize reading and writing, only video and audio).

You are trying to read a non media file, which is not owned by your app

See here Some basics on Android storage system

You have to use SAF to do this

Taifun

prova.aia (38.7 KB)
Enough, I give up, I resign myself to not understanding what's wrong.
If you want, take a look, I can't take it anymore :slight_smile:

*UPLOAD*

*<?php                         *

*if (isset($_FILES['file'])) {*
*    $target_dir = "storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/"; //*emphasized text**

*    $target_file = $target_dir . basename($_FILES["file"]["name"]);*

*    // Sposta il file dalla cartella temporanea alla destinazione finale*
*    if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {*
*        echo "Il file ". htmlspecialchars( basename( $_FILES["file"]["name"])). " è stato caricato con successo.";*
*    } else {*
*        echo "Si è verificato un errore durante il caricamento del file.";*
*    }*
*} else {*
*    echo "Nessun file ricevuto.";*
*}*
*?>*

*download*


<?php
// Controlla se è stato specificato un nome di file
$_GET['filename']
if (isset($_GET['filename'])) {
    $filename = $_GET['filename'];
    $file_path = "//ufo1.byethost14.com/" . $filename;

    if (file_exists($file_path)) {
        // Imposta gli header per forzare il download
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="'.basename($file_path).'"');
        header('Expires: 0');
        header('Cache-Control: must-revalidate');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file_path));
        
        // Legge il file e lo invia al browser
        readfile($file_path);
        exit;
    } else {
        http_response_code(404);
        echo "Il file non è stato trovato.";
    }
} else {
    echo "Nessun nome di file specificato.";
}
?>