Skip to content

Commit

Permalink
address issue #15: file name could have many dots
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Aug 21, 2016
1 parent c4ad5ec commit e495309
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flask_excel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ class ExcelRequest(webio.ExcelInputInMultiDict, Request):
Mix in pyexcel's webio function signatures to Flask request
"""
def get_file_tuple(self, field_name):
"""
Implement Flask specific way of getting uploaded files
"""
filehandle = self.files[field_name]
filename = filehandle.filename
extension = filename.split(".")[1]
extension = filename.split(".")[-1]
if extension == filename:
raise IOError("Failed to find out file extension")
return extension, filehandle


Expand Down

0 comments on commit e495309

Please sign in to comment.