Unfortunately this doesn't seem to be the case, since, as I've written above, the same file is successfully uploaded from the android version of my app. Strange...The post method has no limit at the b4x side but on the server you can set the maximum:
https://www.dokuwiki.org/faq:uploadsize
I've done uploads of 5 MB without any problems. Maybe the hoster does not want large files to be uploaded.
Dim myj As HttpJob
myj.Initialize("uploaddb",Me)
myj.PostFile(myPHPScript,File.DirApp,filename)
myj.Username="username"
myj.Password ="userpass"
Dim ajob As HttpJob
ajob.Initialize ("uploaddb",Me)
ajob.Username ="username"
ajob.Password ="userpass"
ajob.PostFile(myPHPScript,File.DirDefaultExternal ,filename)
(Un)fortunately, I've checked older compiles, no difference. However, I remember upgrading to 1.8+ jre (runtime of course), so I'll try downgrading and see if something's really changed. Thank you!Did you recently upgrade to the latest B4J-version? If you did, try to get hold of a previous version and try it. Who knows, maybe something was changed in the supporting libraries?
B4J (problem above 100kb):
Have you tried to set username and password in the same order?B4A (no problem):
Dim myj As HttpJob
myj.Initialize("uploaddb",Me)
myj.PostFile(myPHPScript,File.DirApp,filename)
myj.Username="username"
myj.Password ="userpass"
Dim myj As HttpJob
myj.Initialize("uploaddb",Me)
myj.Username="username"
myj.Password ="userpass"
myj.PostFile(myPHPScript,File.DirApp,filename)
Great you sorted it outSomehow it seems that the whole thing started after updating to 101.
For sure it is NOT a B4J or Java problem.
1. Can you post your php script? (maybe the problem is here)
2. I could upload it to my server and we could give it a try
3. Do you have a test environment? (like I'm using XAMPP to test my creations)
$FileName = $_GET['FileName'];
if (!$FileName)
$FileName = "FileName";
if (strstr($FileName,"php"))
return;
$PostData = file_get_contents("php://input");
$File = fopen("./clients/" . $FileName,"wb");
fwrite($File, $PostData);
fclose($File);
echo "success";
Thank you very much Erel. Unfortunately, testing with 3.71 threw an error: toolkit not initialized. Anyway, I don't have much time now to take are of this error, but I guess version will not make a differenceYou can download v3.7 from this link: www.b4x.com/b4j/files/B4J_3.7.exe
Other versions are not available.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?