OSDN Git Service

fixed filename-bug of upload file contains space/
authorelixirel <elixirel@users.sourceforge.jp>
Sun, 17 May 2009 16:12:38 +0000 (01:12 +0900)
committerelixirel <elixirel@users.sourceforge.jp>
Sun, 17 May 2009 16:12:38 +0000 (01:12 +0900)
filemanager.rb

index 1cfa839..4a15b80 100644 (file)
@@ -101,7 +101,7 @@ class WebFiler
     raise "Target dir not found." unless check_dir_exist?(pwd)
   end
   
-  attr_reader :basepath, :relpath_list
+  attr_reader :basepath
   attr_accessor :relpath_list
   
   # ディレクトリ内部のファイル・フォルダ一覧を取得するメソッド
@@ -232,7 +232,7 @@ class Controller
         filer.relpath_list = db["relpath_list"]
         
         if (cgi["updata"].size <= UPLOADLIMIT)
-          filer.upload(cgi["updata"], cgi["updata"].original_filename)
+          filer.upload(cgi["updata"], cgi["updata"].original_filename.gsub(/ /, "_"))
         else
           db["error"] = "ファイルの容量が大きすぎます!"
         end