<% if _SESSION["username"] ~= nil and _SESSION["currentpath"] ~= nil then local filename = _GET["filename"] or _POST["filename"] or nil local expiretime = _GET["expiretime"] or _POST["expiretime"] or "" local downloadlimit = _GET["downloadlimit"] or _POST["downloadlimit"] or "" local sendmail = _GET["sendmail"] or _POST["sendmail"] or "" local mailaddress = _GET["mailaddress"] or _POST["mailaddress"] or "" local localaddress = _GET["localaddress"] or _POST["localaddress"] or "" if filename ~= nil then if downloadlimit == "" then downloadlimit = "-1" end local nowdir = string.gsub(_SESSION["currentpath"],":{{","%[") nowdir = string.gsub(nowdir,"}}:","%]") local result = c_UpdateWebLink(_SESSION["username"],filename,nowdir,expiretime,downloadlimit) if sendmail == "yes" and mailaddress ~= "" and localaddress ~= "" then local weblink = Split(c_GetWebLink(_SESSION["username"],filename,nowdir), "\r\n") local url = localaddress.."?download&weblink="..weblink[1].."&realfilename="..filename; local subject = "A file has been sent to you - ["..filename.."]" local content = [[ A file has been sent to you!

]]..filename..[[


You can download the file with the following URL:
]]..url..[[ ]] c_SendMessage(mailaddress, subject, content, true) end if result ~= "" and result ~= "noperm" then c_AddWebLog("User '".._SESSION["username"].."' updated Web-Link for the file '"..filename.."'",_SESSION_ID,DOMAIN_LOG_WEB_RESPOND) end else print("") end end %>