tcztzy / django-multiple-file-chunked-upload Goto Github PK
View Code? Open in Web Editor NEWUpload plugin for Django which support multiple file chunked upload simultaneously.
License: MIT License
Upload plugin for Django which support multiple file chunked upload simultaneously.
License: MIT License
I am trying to use this module in my project. I had to apply only one change in views to generate dataset_name on fly without asking for form field for it, so I replaced
dataset = self.get_or_create_dataset(request.POST.get('dataset_name'))
with
dataset_name = "dsname_%s" % chunk._get_name()
dataset = self.get_or_create_dataset(dataset_name)
But now, when view executes this line:
if chunked_upload.is_finished:
it fails in the model in this part:
@property
def md5(self):
md5 = hashlib.md5()
for chunk in self.file.chunks():
md5.update(chunk)
return md5.hexdigest()
particurarly at line
for chunk in self.file.chunks():
when he tries to loop over all chunks.
I tried this code with django-1.9.1 and also 1.11.2 and it is all the same.
I made some small changes to debug the problem:
@property
def md5(self):
print("f0")
md5 = hashlib.md5()
print(self.file)
print(self.file.chunks())
for chunk in self.file.chunks():
print("f1")
md5.update(chunk)
print("f2")
return md5.hexdigest()
and the output is
f0
<generator object File.chunks at 0x7fd3af0f10f8>
[22/Aug/2017 12:25:14] "POST /upload/chunk/ HTTP/1.1" 500 67
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.