浏览代码

"[fb] Make archive upload case insensitive"

krish 11 年之前
父节点
当前提交
5be7a0c336
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      apps/filebrowser/src/filebrowser/views.py

+ 2 - 2
apps/filebrowser/src/filebrowser/views.py

@@ -1229,13 +1229,13 @@ def _upload_archive(request):
         try:
             # Extract if necessary
             # Make sure dest path is without the extension
-            if dest.endswith('.zip'):
+            if dest.lower().endswith('.zip'):
                 temp_path = archive_factory(uploaded_file, 'zip').extract()
                 if not temp_path:
                     raise PopupException(_('Could not extract contents of file.'))
                 # Move the file to where it belongs
                 dest = dest[:-4]
-            elif dest.endswith('.tar.gz') or dest.endswith('.tgz'):
+            elif dest.lower().endswith('.tar.gz') or dest.lower().endswith('.tgz'):
                 print uploaded_file
                 temp_path = archive_factory(uploaded_file, 'tgz').extract()
                 if not temp_path: