Hello All...
I am exploring a way in which I can upload two or more files at once using the HTTP post. At present I am able to upload single file successfully using the code below...
How can I achieve the option of uploading two files at once. My search in Google showed me some examples of uploading two files at once.The link below says PHP is capable of receiving multiple files.
http://php.net/manual/en/features.file-upload.multiple.php
I am trying this option because I have 1000s of small images to upload (each approx 10kb) and many posts in other forums suggested "Sending multiple images in a single package makes sense".
Also if some one has done such thing before can you please guide me the most efficient method of ensuring the file is uploaded to the server before deleting...
Thanks in Advance...
Regards,
Sangee
I am exploring a way in which I can upload two or more files at once using the HTTP post. At present I am able to upload single file successfully using the code below...
B4X:
Dim job2 As HttpJob
job2.Initialize(Filename,Me)
job2.PostFile("http://myserver.com/uploadimg.php?filename=" & Filename,File.DirRootExternal & "/download/Images/", Filename)
Sub JobDone (Job As HttpJob)
Dim Filename As String
Dim Qstr As String
'Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Filename = Job.JobName
File.Delete (File.DirRootExternal & "/download/Images/",Filename)
Qstr = "DELETE FROM FilesToSend WHERE file = ?"
SQL1.ExecNonQuery2(Qstr, Array As Object(Filename))
Else
'Update DB
Filename = Job.JobName
'Qstr = "INSERT INTO FilesToSend (id, File, status) VALUES (NULL, '" & Filename & "','WAITING')"
'SQL1.ExecNonQuery(Qstr)
Qstr = "UPDATE FilesToSend SET status = ? WHERE file = ?"
SQL1.ExecNonQuery2(Qstr, Array As Object("WAITING", Filename))
End If
Job.Release
End Sub
How can I achieve the option of uploading two files at once. My search in Google showed me some examples of uploading two files at once.The link below says PHP is capable of receiving multiple files.
http://php.net/manual/en/features.file-upload.multiple.php
I am trying this option because I have 1000s of small images to upload (each approx 10kb) and many posts in other forums suggested "Sending multiple images in a single package makes sense".
Also if some one has done such thing before can you please guide me the most efficient method of ensuring the file is uploaded to the server before deleting...
Thanks in Advance...
Regards,
Sangee