Glassfish jersey FormDataContentDisposition getSize returns -1

I have a RESTful Jersey web service under Glassfish that accepts incoming POST requests to download images while consuming MediaType.MULTIPART_FORM_DATA, which maps to mime type multiplayer.

When I get a copy FormDataContentDisposition fileDetailin my service and callfileDetail.getSize()

I always get -1

I wonder how to choose the right file size using file uploads using Jersey and Multipart.

+4
source share
1 answer

I also ran into this problem and now I am looking for RCA and solutions.

: File # length(), .

:

, , ( , ), .

, , , , .

+1

Source: https://habr.com/ru/post/1614390/


All Articles