How do I write a restful web service that accepts a binary file (pdf)

前端 未结 3 1613
后悔当初
后悔当初 2020-12-04 20:29

I\'m trying to write a restful web service in java that will take a few string params and a binary file (pdf) param.

I understand how to do the strings but I\'m get

3条回答
  •  离开以前
    2020-12-04 21:01

    You could store the binary attachment in the body of the request instead. Alternatively, check out this mailing list archive here:

    http://markmail.org/message/dvl6qrzdqstrdtfk

    It suggests using Commons FileUpload to take the file and upload it appropriately.

    Another alternative here using the MIME multipart API:

    http://n2.nabble.com/File-upload-with-Jersey-td2377844.html

提交回复
热议问题