开发者

php api digest authentication multipart form data

开发者 https://www.devze.com 2023-02-13 11:54 出处:网络
what is the best way for a php rest api server to receive images from a client (here iphone). Currently, we are sending the base 64 encoded content of the image fi开发者_运维技巧le to the api server

what is the best way for a php rest api server to receive images from a client (here iphone).

Currently, we are sending the base 64 encoded content of the image fi开发者_运维技巧le to the api server from iphone as a POST variable. At server end, we decode this variable and then we are creating a new file based on the decoded content. this works fine.

What are the other ways we can receive images?


For ease of receiving it in PHP, post it as a binary with multipart/form-data and access it via the $_FILES array. You could also do it as an HTTP PUT.

0

精彩评论

暂无评论...
验证码 换一张
取 消