chunk_length can be converted to a local variable, because it is always reset to 0 after it was used.
Attach a file by drag & drop or click to upload