make sure path exists

This commit is contained in:
j 2011-12-30 12:11:57 +05:30
parent a9ae0ab5e6
commit d48254c1d2

View file

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