服务端获取图片

请问我怎么获取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>
阅读 5.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题