首页 > 服务端获取图片

服务端获取图片

请问我怎么获取ios客户端上传的图片呢,用的是web.py的POST方法

 def POST(self):
        user_data = web.input()
        user_name = user_data.get("usrname")
        user_type = user_data.get("type")
        x = web.input(pic={})

或者

    def POST(self):
        user_data = web.input()
        user_name = user_data.get("usrname")
        pic_type = user_data.get("type")
        pic_content = user_data.get("pic")

貌似都不行啊。或者ios客户端该怎么做呢?
我做个html表单测试,第一种方法就能上传图片。

<html><head></head><body>
                    <form method="POST" enctype="multipart/form-data" action="">
                    <input type="file" name="pic" />
                    <br/>
                    <input type="string" name="usrname" />
                    <br/>
                    <input type="string" name="type" />
                    <br/>
                    <input type="submit" />
                    </form>
                    </body></html>

http://stackoverflow.com/questions/15956805/retrieve-http-post-variables-using-multipart-form-data-sent-from-an-ios-device

【热门文章】
【热门文章】