Anonymous Page

Source Code

    import com.fastscala.templates.bootstrap5.classes.BSHelpers._
    JS.rerenderable(rerenderer => implicit fsc => {
      div.border.p_2.rounded.apply {
        h3.apply("Upload an image:") ++
          FileUpload(uploadedFile => {
            rerenderer.rerender()
            JS.redirectTo(fsc.anonymousPageURL[FSScalaXmlEnv.type](implicit fsc => {
              new VisualizeUploadedImageAnonymousPage(uploadedFile.head.contentType, uploadedFile.head.content).render()
            }, "visualize_image"))
          })
      }
    }).render()

Upload an image: