summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/web/luasrc/cbi.lua6
-rw-r--r--libs/web/luasrc/view/cbi/simpleform.htm2
2 files changed, 4 insertions, 4 deletions
diff --git a/libs/web/luasrc/cbi.lua b/libs/web/luasrc/cbi.lua
index 8b9805f04..ff030a268 100644
--- a/libs/web/luasrc/cbi.lua
+++ b/libs/web/luasrc/cbi.lua
@@ -102,7 +102,7 @@ function load(cbimap, ...)
for _, field in ipairs(map.upload_fields) do
uploads[
field.config .. '.' ..
- field.section.sectiontype .. '.' ..
+ (field.section.sectiontype or '1') .. '.' ..
field.option
] = true
end
@@ -124,8 +124,8 @@ function load(cbimap, ...)
)()
if c and s and o then
- local t = uci:get( c, s )
- if t and uploads[c.."."..t.."."..o] then
+ local t = uci:get( c, s ) or s
+ if uploads[c.."."..t.."."..o] then
local path = upldir .. field.name
fd = io.open(path, "w")
if fd then
diff --git a/libs/web/luasrc/view/cbi/simpleform.htm b/libs/web/luasrc/view/cbi/simpleform.htm
index 1a4726a02..f7c9f3324 100644
--- a/libs/web/luasrc/view/cbi/simpleform.htm
+++ b/libs/web/luasrc/view/cbi/simpleform.htm
@@ -1,5 +1,5 @@
<% if not self.embedded then %>
-<form method="post" action="<%=REQUEST_URI%>">
+<form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
<div>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<input type="hidden" name="cbi.submit" value="1" />