Merge branch 'master' of github.com:webnotes/wnframework

This commit is contained in:
Anand Doshi 2013-02-18 18:03:21 +05:30
commit dff20d01f5

View file

@ -23,6 +23,7 @@
from __future__ import unicode_literals
import webnotes
import os, conf
from webnotes.utils import cstr
def upload():
# get record details
@ -94,7 +95,7 @@ def get_uploaded_content():
# should not be unicode when reading a file, hence using webnotes.form
if 'filedata' in webnotes.form:
i = webnotes.form['filedata']
webnotes.uploaded_filename, webnotes.uploaded_content = i.filename, i.file.read()
webnotes.uploaded_filename, webnotes.uploaded_content = cstr(i.filename), i.file.read()
return webnotes.uploaded_filename, webnotes.uploaded_content
else:
webnotes.msgprint('No File')