19 Jul
2006
19 Jul
'06
3:04 p.m.
Alan wrote:
Hi there!
I managed to find the problem and the solution.
First, I've forgot to mention that in my script, oname is an uploaded file. I just inserted a f.close() and voilá!
def upload_external(self,file,REQUEST): import os,tarfile ... f=open(oname,"wb") f.write(file.read()) f.close() ... tar = tarfile.open(oname,"r:gz") for itar in tar: tar.extract(itar.name,jobdir) return "Done"
Err. why not tar=tarfile.open(fileobj=file) ? Why bother with potentially name clashing files in filesystem? Regards Tino