开发者社区> 问答> 正文

服务端获取图片

请问我怎么获取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>

展开
收起
a123456678 2016-07-27 11:30:35 1908 0
2 条回答
写回答
取消 提交回答
  • 余轶 ![](https://yqfile.alicdn.com/)
    2019-07-17 20:00:28
    赞同 展开评论 打赏
  • 请问我怎么获取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>
    2019-07-17 20:00:28
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载