make sure path exists

This commit is contained in:
j 2011-12-30 12:11:57 +05:30
parent a9ae0ab5e6
commit d48254c1d2
1 changed files with 1 additions and 0 deletions

View File

@ -244,6 +244,7 @@ class File(models.Model):
format=config['formats'][0])
if created:
stream.video.name = stream.name()
ox.makedirs(os.path.dirname(stream.video.path))
with open(stream.video.path, 'w') as f:
f.write(chunk.read())
else: