add PicklableUpload get_content method (#7258)
This commit is contained in:
parent
2255337a50
commit
4f7f35af31
|
@ -687,6 +687,12 @@ class PicklableUpload(Upload):
|
|||
# quack like UploadedFile
|
||||
return self.get_file_pointer()
|
||||
|
||||
def get_content(self):
|
||||
if hasattr(self, 'qfilename'):
|
||||
filename = os.path.join(get_publisher().app_dir, 'uploads', self.qfilename)
|
||||
return file(filename).read()
|
||||
return None
|
||||
|
||||
|
||||
class EmailWidget(StringWidget):
|
||||
HTML_TYPE = 'email'
|
||||
|
|
Loading…
Reference in New Issue