123456789101112131415161718192021222324252627 |
- def uploadFile(self, file, ident, ftype, id=0, linkonly=0):
- bdata = ""
- for l in file.file.readlines():
- bdata += l
- filename = file.filename.split("\\")
- filename = filename[-1:][0]
- ns = {'site': self,
- 'BASE_URL': getConfig().BASE_URL,
- 'ident': ident,
- 'id': id,
- 'filename': filename,
- 'ident_id': makeLinkAble(ident),
- 'linkonly': linkonly,
- 'ftype': ftype}
- ns['data'] = bdata
- if model.Files.countFilesWithFilename(filename):
- ns['new_filename'] = model.Files.newFilename(filename)
- amiweb.session()['upload_ns'] = ns
- return render("skeletonz/plugins/upload/view/upload_already_found.tmpl", ns)
- return self.uploadComplete(ns)
|