Using ServiceStack to upload image files

前端 未结 1 1676
攒了一身酷
攒了一身酷 2020-12-09 22:37

We have a requirement to upload images using ServiceStack APIs.

I am aware of two possible ways:

1) Use JSON object to upload file (Using BASE64 string). 2)

相关标签:
1条回答
  • 2020-12-09 23:30

    The best way to upload files in ServiceStack is to just do a normal HTTP File upload see the source code for imgur.servicestack.net or file uploads in RestFiles for examples.

    If you don't want to send multipart/form-data then use a binary format like Protocol Buffers support in ServiceStack and send byte[] to avoid the computational and payload overhead of encoding binary files in a text format.

    0 讨论(0)
提交回复
热议问题