upload_3_5.py 640 B

12345678910111213141516171819202122
  1. def uploadComplete(self, ns):
  2. id = ns['id']
  3. bdata = ns['data']
  4. ftype = ns['ftype']
  5. ident = ns['ident']
  6. linkonly = ns['linkonly']
  7. filename = ns['filename']
  8. if id != 0:
  9. file_obj = model.Files.uploadFileEdit(id, filename, ftype, bdata)
  10. else:
  11. file_obj = model.Files.uploadFile(ident, filename, ftype, bdata)
  12. ns['filename'] = file_obj.getFilename()
  13. new_html = self.getEditHTML(ftype, ident, linkonly)
  14. new_html = new_html.replace("'", "\\'")
  15. ns['new_html'] = new_html
  16. AmiCache.expireCurrentPage()
  17. return render("skeletonz/plugins/upload/view/upload_complete.tmpl", ns)