1.让.net一个个按顺序传,但让用户感觉是批量2.让.net把所有图片打包,比如压缩成rar格式,至于顺序信息,一起打到压缩包中,然后扔到服务器。暂时想到这两 

解决方案 »

  1.   

    或者干脆把图片转成base64发上去得了
      

  2.   

    这里有个解决办法stack overflow找到的,看上去挺好的,将创建文件和传输文件内容分开
    ,先post 你所有文件meta,这样服务端对每个文件创建,然后就可以并行上传每个文件内容了,每个文件对应的id不同
    http://stackoverflow.com/questions/3938569/how-do-i-upload-a-file-with-metadata-using-a-rest-web-serviceI agree with Greg that a two phase approach is a reasonable solution, however I would do it the other way around. I would do:POST http://server/data/media
    body:
    {
        "Name": "Test",
        "Latitude": 12.59817,
        "Longitude": 52.12873
    }
    To create the metadata entry and return a response like:201 Created
    Location: http://server/data/media/21323
    {
        "Name": "Test",
        "Latitude": 12.59817,
        "Longitude": 52.12873,
        "ContentUrl": "http://server/data/media/21323/content"
    }
    The client can then use this ContentUrl and do a PUT with the file data.The nice thing about this approach is when your server starts get weighed down with immense volumes of data, the url that you return can just point to some other server with more space/capacity. Or you could implement some kind of round robin approach if bandwidth is an issue