uploading multiple files with pyramid

一曲冷凌霜 提交于 2019-12-05 06:51:59

I've found a way to solve it, I believe there are many others, if there are, please feel free to holler out:

    fileslist = request.POST.getall('files')
    print ("My files listing: ", fileslist)
    for f in fileslist:
        print ( "individual files: ", f )

I could solve the problem with the following function:

from cgi import FieldStorage
def get_all_file_data_list(request):
    return [x for x in request.POST.values() if isinstance(x, FieldStorage)]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!