Hi,
I've been trying kendo-upload with angular.
I keep getting unsupported media type from the server (error: 415). I am wondering if the
boundary=----WebKitFormBoundaryARilQnC5oS7lnLVU
is making server have any issues or is there something else that's causing this?
Can you please provide guidance on how to have java service (jax-rs) based handle the request from UI? (in the same way you've given for asp.net)
Here's the angular configuration
<
div
class
=
"demo-section k-content"
ng-controller
=
"UploadController"
><
input
name
=
"files"
id
=
"files"
type
=
"file"
kendo-upload
=
"uploader"
k-select
=
"onSelect"
k-async
=
"{ saveUrl: 'http://localhost:8080/path/to/upload', autoUpload: true }"
/></
div
>
The java server side code for handling post
@POST@Consumes(MediaType.MULTIPART_FORM_DATA)public void uploadFiles(@FormDataParam("files") List<
InputStream
> files) {System.out.println("Reached UploadFiles");}
This is the request made as seen on Chrome/Developer tools/Network
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryARilQnC5oS7lnLVURequest Payload------WebKitFormBoundaryARilQnC5oS7lnLVUContent-Disposition: form-data; name="files"; filename="test_blah.txt"Content-Type: text/plain ------WebKitFormBoundaryARilQnC5oS7lnLVU--