% local fs = require "nixio.fs" %> <%+header%>
<%:edf_desc%>
<% if state == "update" then %> <% contents = string.gsub(contents, "\r\n", "\n") local size = fs.writefile(filepath, contents) %> <%:edf_upload_succeeded%>(bytesize = <%=size%> bytes) <% elseif state == "load" then %> <% local contents = fs.readfile(filepath) or "" local empty if contents == "" then empty = 1 end %> <% if empty == 1 then %> <%:edf_no_such_files%> <% else %> <% end %> <% else %> <% end %> <%+footer%>