title: QUploader component in Julia
body: <p>I have been developing an application in Julia using Genie Framework and Stipple, and the main task of this app is to implement Sobel and Prewitt operator. The problem that I am struggling with is the uploader component. So basically I am able to upload an image, on button click the image is transformed, but then when i upload another image and try to output the transformed version of it, the output that i get is still the old image. I have been trying to find the issue and I noticed that QUploader API has some methods that could help solve this problem: <code>reset()</code> method, or <code>removeUploadedFiles()</code> method, but I do not know how to call/use these functions regarding Julia syntax. Are there any solutions available?</p>
  <pre><code>
  
  const FILE_PATH = &quot;public/sample.jpg&quot;
  const FINAL_PATH = &quot;final.jpg&quot;
  #const IMGPATH = &quot;demo.png&quot;
  
  model = Model |&gt; init
  
  
  on(model.process_s3) do _
      model.imageurl[] = &quot;&quot;
      @info &quot;Working&quot;
  
      img = FileIO.load(FILE_PATH)
      img_gray = Gray.(img)
  
      @info img_gray
      sobel_image = convert(Array{Float64}, img_gray)
     
      lastImage = clamp01nan.(sobel(sobel_image, sobel3_kernel_x, sobel3_kernel_y))
      save(joinpath(@__DIR__, &quot;public&quot;, FINAL_PATH), lastImage)
      model.imageurl[] = &quot;/$FINAL_PATH#$(Base.time())&quot; * string(rand())
  
      @info model.imageurl[]
      if (model.process_s3[])
          model.process_s3[] = false
      end 
      
  end
  
  
  function ui(model)
      [
          page( model,
              class = &quot;container&quot;,
              title = &quot;Card Demo&quot;,
              partial = true,
              [
                  row( # row takes a tuple of cells. Creates a `div` HTML element with a CSS class named `row`.
                      cell([h1(&quot;Edge Detection Project&quot;)]),
                  )
                  row(
                      [
                          cell(class=&quot;st-module&quot;, [
                              h2(&quot;Initial Image&quot;),
                              card(
                                  class = &quot;q-pa-md row items-start q-gutter-md&quot;,
                                 
                                      uploader(
                                              label = &quot;Upload Image&quot;,
                                              method = &quot;POST&quot;,
                                              :multiple,
                                              url = &quot;http://localhost:8000/upload&quot;,
                                              field__name = &quot;img&quot;,
                                              :finish=&quot;finished&quot;,
                                              ref=&quot;uploader&quot;
  
                                          ),
                              
                              ),
                      
                                  
                              btn(&quot;Sobel 3x3&quot;,color=&quot;primary&quot;, @click(&quot;process_s3 = true&quot;)),
                       
                              
                          ])
                          cell(class=&quot;st-module&quot;, [
                              h2(&quot;Transformed Image&quot;),
                              card(
                                  class = &quot;q-pa-md row items-start q-gutter-md&quot;,
                                  #quasar(:img, src=:imageurl, spinner__color=&quot;white&quot;, style=&quot;height: 300px; max-width: 350px&quot;)
                                  imageview(src=:imageurl, spinner__color=&quot;white&quot;, style=&quot;height: 250px; max-width: 250px&quot;)
  
                              ),
                          ])
                      ],
                  )
              ],
          ),
      ]
  end
  
  route(&quot;/&quot;) do
      html(ui(model), context = @__MODULE__)
  end
  
  
  route(&quot;/upload&quot;, method = POST) do
      if infilespayload(:img)
          @info Requests.filename(filespayload(:img))
          
          open(FILE_PATH, &quot;w&quot;) do io
              write(FILE_PATH, filespayload(:img).data)
          @info File
          end
      else
          @info &quot;No image uploaded&quot;
         
      end 
      Genie.Renderer.redirect(:get)
  end
  
  # isrunning(:webserver) || up()
  
  </code></pre>