<%
local t = require("luci.tools.webadmin")
local v = self:cfgvalue(section)
+ v = v and nixio.fs.stat(v)
-%>
<%+cbi/valueheader%>
<% if v then %>
- <%:cbi_upload Uploaded File%> (<%=t.byte_format(luci.fs.stat(v).size or 0)%>)
+ <%:cbi_upload Uploaded File%> (<%=t.byte_format(v.size)%>)
<input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
- <input type="image" value="<%:cbi_replace%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" />
+ <input class="cbi-input-image" type="image" value="<%:cbi_replace%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" />
<% else %>
- <input type="file"<%= attr("name", cbid) .. attr("id", cbid) %> />
+ <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> />
<% end %>
<%+cbi/valuefooter%>