Hi Erel,
I am struggling with image file upload thru MultipartPost.
As you said i removed okHttputils2 library and added HttpUtils2Service.bas inside HttpUtils2_Scr.zip(as it is not compatible with B4A)
I am using
https://www.b4x.com/android/forum/threads/android-http-multipart-requests.8411/ for uploading image file
It gives error on line Dim hc As HttpClient
If i change HttpClient to okHttpClient it will compile is it correct ?
Finally after running it wont upload gives error "ModSecurity Action 501"
Just for info i am using this on ASP side
HttpFileCollection uploadFiles = Request.Files;
// Build HTML listing the files received.
string summary = "<p>Files Uploaded:</p><ol>";
// Loop over the uploaded files and save to disk.
int i;
for (i = 0; i < uploadFiles.Count; i++)
{
HttpPostedFile postedFile = uploadFiles
;
// Access the uploaded file's content in-memory:
System.IO.Stream inStream = postedFile.InputStream;
byte[] fileData = new byte[postedFile.ContentLength];
inStream.Read(fileData, 0, postedFile.ContentLength);
// Save the posted file in our "data" virtual directory.
postedFile.SaveAs(Server.MapPath("App") + "\\" + postedFile.FileName);
(I am sorry i am not getting "code tags" ??)
Pls help me on this.