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 .............
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
"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.
@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?
@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.
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).
*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.";
}
?>