Ajouter upload de fichier par form html #49
2 changed files with 13 additions and 0 deletions
|
@ -201,6 +201,8 @@ func RunServer() {
|
||||||
|
|
||||||
groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload)
|
groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload)
|
||||||
|
|
||||||
|
groupAdmin.POST("/documents/upload", handleAdminDocumentsUploadPOST)
|
||||||
|
|
||||||
e.Logger.Fatal(e.Start(
|
e.Logger.Fatal(e.Start(
|
||||||
fmt.Sprintf(":%d", viper.GetInt("server.port"))))
|
fmt.Sprintf(":%d", viper.GetInt("server.port"))))
|
||||||
}
|
}
|
||||||
|
@ -726,6 +728,16 @@ func handleAdminDocumentsUpload(c echo.Context) error {
|
||||||
return c.Render(http.StatusOK, "admin-upload-html", nil)
|
return c.Render(http.StatusOK, "admin-upload-html", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleAdminDocumentsUploadPOST(c echo.Context) error {
|
||||||
|
data := struct {
|
||||||
|
Message string
|
||||||
|
}{
|
||||||
|
Message: "Pas implémenté",
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Render(http.StatusOK, "admin-upload-html", data)
|
||||||
|
}
|
||||||
|
|
||||||
// CSS Handlers
|
// CSS Handlers
|
||||||
|
|
||||||
func handleStaticCSSIndex(c echo.Context) error {
|
func handleStaticCSSIndex(c echo.Context) error {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<body>
|
<body>
|
||||||
{{ template "header-html" }}
|
{{ template "header-html" }}
|
||||||
<h1>Upload</h1>
|
<h1>Upload</h1>
|
||||||
|
<p>{{ .Message }}</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue