+
+def read_result_file(self, key):
+ """Return the contents of filename if everything is approved
+ """
+ data_file = get_object_or_404(DataFile, random_key = key)
+
+ mimetype = 'application/octet-stream'
+ if data_file.file_type.mimetype is not None:
+ mimetype = data_file.file_type.mimetype
+
+ if os.path.exists(data_file.pathname):
+ return HttpResponse(open(data_file.pathname,'r'),
+ mimetype=mimetype)
+
+ raise Http404
+
+