Hi,
this is from multipartpost.createpostrequest with a try-catch.
The log:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (upload) Create, isFirst = true **
logging fd.dir, fd.filename: both correct
/storage/emulated/0/Android/data/A.Tag/files/5
15.jpg
** Activity (upload) Resume **
An error occurred:
(Line: 30) FD = Files.Get(i)
java.lang.ClassCastException: java.lang.Short cannot be cast to java.lang.Boolean
1. Why does try-catch not work?
2. What might be the reason?
Thank you all
Peter
this is from multipartpost.createpostrequest with a try-catch.
B4X:
For i = 0 To Files.Size - 1
FD = Files.Get(i)
Try
b = ("--" & boundary & EOL & "Content-Disposition: form-data; name=" _
& QUOTE & FD.KeyName & QUOTE & "; filename=" & QUOTE & FD.FileName & QUOTE _
& EOL & "Content-Type: " & FD.ContentType & EOL & EOL).GetBytes("UTF8")
stream.WriteBytes(b, 0, b.Length)
Dim In As InputStream
Log (FD.Dir)
Log (FD.FileName)
In = File.OpenInput(FD.Dir, FD.FileName)
File.Copy2(In, stream) 'read the file and write it to the stream ' herre the debugger stops
b = EOL.GetBytes("UTF8")
stream.WriteBytes(b, 0, b.Length)
Catch
Log (LastException.Message)
End Try
Next
The log:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (upload) Create, isFirst = true **
logging fd.dir, fd.filename: both correct
/storage/emulated/0/Android/data/A.Tag/files/5
15.jpg
** Activity (upload) Resume **
An error occurred:
(Line: 30) FD = Files.Get(i)
java.lang.ClassCastException: java.lang.Short cannot be cast to java.lang.Boolean
1. Why does try-catch not work?
2. What might be the reason?
Thank you all
Peter