Skip to main content
added 1 characters in body
Source Link
ars
  • 124k
  • 23
  • 151
  • 135

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES.getlist('form_file'):
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES.getlist('form_file'):
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES.getlist('form_file'):
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES.getlist('form_file':
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES.getlist('form_file'):
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES.getlist('form_file'):
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()
added 15 characters in body
Source Link
ars
  • 124k
  • 23
  • 151
  • 135

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES['form_file']FILES.getlist('form_file'):
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES['form_file']FILES.getlist('form_file':
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES['form_file']:
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES['form_file']:
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES.getlist('form_file'):
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES.getlist('form_file':
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()
deleted 14 characters in body
Source Link
ars
  • 124k
  • 23
  • 151
  • 135

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES['form_file']:
    filename = upfile['filename']upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES['form_file']:
    filename = upfile['filename']upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES['form_file']:
    filename = upfile['filename']
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES['form_file']:
    filename = upfile['filename']
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()

Based on your file element form_file, the value in request.FILES['form_file'] should be a list of files. So you can do something like:

for upfile in request.FILES['form_file']:
    filename = upfile.name
    # instead of "filename" specify the full path and filename of your choice here
    fd = open(filename, 'w')
    fd.write(upfile['content'])
    fd.close()

Using chunks:

for upfile in request.FILES['form_file']:
    filename = upfile.name
    fd = open(filename, 'w+')  # or 'wb+' for binary file
    for chunk in upfile.chunks():
        fd.write(chunk)
    fd.close()
added 256 characters in body
Source Link
ars
  • 124k
  • 23
  • 151
  • 135
Loading
Source Link
ars
  • 124k
  • 23
  • 151
  • 135
Loading