diff --git a/app/controllers/admin/hps_learnings_controller.rb b/app/controllers/admin/hps_learnings_controller.rb index 2479afa..223dc7d 100644 --- a/app/controllers/admin/hps_learnings_controller.rb +++ b/app/controllers/admin/hps_learnings_controller.rb @@ -109,11 +109,14 @@ class Admin::HpsLearningsController < OrbitAdminController Zip::ZipFile.open(path) { |zip_file| zip_file.each { |f| f_path=File.join(destination, f.name) - zip_file.extract(f, f_path) unless File.exist?(f_path) files << f.name + zip_file.extract(f, f_path) unless File.exist?(f_path) } } - if files.include?("index.html") + foldername = File.basename(path).split(".") + foldername.pop + foldername = foldername.join(".") + if files.include?(foldername + "/index.html") render :json => {"success" => true}.to_json else render :json => {"success" => false, "msg" => "index.html file not present."}.to_json