HttpUtils2 - upload file error

jpvniekerk

Active Member
Licensed User
Longtime User
When I try to upload a file with HttpUtils2, I get "Error: forbidden"

I've changed the permissions for the folder to 777, but no luck.

I can download a file from the same URL without any problems.

(replaced the actual urls details with ____)
B4X:
   Dim job1,job2 As HttpJob
   Dim myurl,dlfilename,ulfiledir,lufilename As String

   job1.Initialize("Job1", Me)
   job2.Initialize("Job2", Me)

        myurl = "http://www.__________.com/_________/"
        dlfilename = "testdlfile.txt"
        ulfiledir = File.DirRootExternal
        ulfilename = "testulfile.txt"

   job1.Download(myurl&dlfilename)
   job2.PostFile(myurl,ulfiledir,ulfilename)

What am I doing wrong (or omitting)?
 

jpvniekerk

Active Member
Licensed User
Longtime User
I'm not clued up on PHP or anything similar - is there any examples of how to do this available?
 
Upvote 0

jpvniekerk

Active Member
Licensed User
Longtime User
Thanks Erel, I will give it a try.
This will always save the file with the name "test.txt" (or whatever you put in the command).
How can I save the file with the name of the file being uploaded (as named in b4a)?
 
Upvote 0

jpvniekerk

Active Member
Licensed User
Longtime User
Thanks Erel,

Don't quite know how to do that...

I'll have to brush up on PHP some more!!! (I understand that PHP is not really part of this forum)
 
Upvote 0
Top