mirror of
https://github.com/lxsang/antd-web-apps
synced 2025-07-26 10:39:46 +02:00
allow download pdf file
This commit is contained in:
@ -9,4 +9,22 @@ end
|
||||
function IndexController:actionnotfound(...)
|
||||
self.template:setView("index")
|
||||
return self:index(table.unpack({...}))
|
||||
end
|
||||
|
||||
function IndexController:json(...)
|
||||
std.json()
|
||||
echo( JSON.encode(REQUEST))
|
||||
return false
|
||||
end
|
||||
|
||||
function IndexController:get(...)
|
||||
return true
|
||||
end
|
||||
|
||||
function IndexController:form(...)
|
||||
return true
|
||||
end
|
||||
|
||||
function IndexController:upload(...)
|
||||
return true
|
||||
end
|
15
apps/views/default/index/form.ls
Normal file
15
apps/views/default/index/form.ls
Normal file
@ -0,0 +1,15 @@
|
||||
<?lua
|
||||
if REQUEST.method == "POST" then
|
||||
return echo(JSON.encode(REQUEST))
|
||||
end
|
||||
?>
|
||||
<form action="https://apps.localhost:9195/index/form" method="post">
|
||||
<fieldset>
|
||||
<legend>Personal information:</legend>
|
||||
First name:<br>
|
||||
<input type="text" name="firstname" value="Mickey"><br>
|
||||
Last name:<br>
|
||||
<input type="text" name="lastname" value="Mouse"><br><br>
|
||||
<input type="submit" value="Submit">
|
||||
</fieldset>
|
||||
</form>
|
3
apps/views/default/index/get.ls
Normal file
3
apps/views/default/index/get.ls
Normal file
@ -0,0 +1,3 @@
|
||||
<?lua
|
||||
echo(JSON.encode(REQUEST))
|
||||
?>
|
12
apps/views/default/index/upload.ls
Normal file
12
apps/views/default/index/upload.ls
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
<?lua
|
||||
if REQUEST.method == "POST" then
|
||||
return echo(JSON.encode(REQUEST))
|
||||
end
|
||||
?>
|
||||
<form action="https://apps.localhost:9195/index/upload" method="post" enctype="multipart/form-data">
|
||||
Select image to upload:
|
||||
<input type="file" name="fileToUpload" id="fileToUpload">
|
||||
<input type="file" name="fileToUpload1" id="fileToUpload1">
|
||||
<input type="submit" value="Upload Image" name="submit">
|
||||
</form>
|
Reference in New Issue
Block a user