Giter VIP home page Giter VIP logo

Comments (6)

gadfly361 avatar gadfly361 commented on August 21, 2024 1

@gosukiwi Unfortunately, I am not well versed with file uploads. This is a stripped down (and now untested) version of something I have done in the past - it may be more in line with what you wanted:

(defn upload-image []
  [:div
   [:iframe {:name  "some-target-name"
             :style {:display "none"}}]
   [:form
    {:method    "post"
     :enc-type  "multipart/form-data"
     :action    "/api/some-endpoint"
     :target    "some-target-name"
     :on-submit #(foobar %)}
    [:input
     {:id   "id-file"
      :type "file"
      :name "id-file"}]
    [:button
     {:id "submit"}
     "Send File"]]])

The accompanying backend is another piece, but this would be the 'reagenty' part.

from reagent-cookbook.

gadfly361 avatar gadfly361 commented on August 21, 2024

@gosukiwi I added a recipe called file-upload. I used the service filestack which appears to be pretty popular and supports s3, dropbox, Azure, etc.

from reagent-cookbook.

gosukiwi avatar gosukiwi commented on August 21, 2024

Oh wow, thanks a lot! It's great! Originally I ment just a file upload to a local web server though, checking out that solution it seems that they host the files themselves. Maybe I'm mistaken though.

from reagent-cookbook.

gadfly361 avatar gadfly361 commented on August 21, 2024

@gosukiwi Is this issue ok to close or are you still searching for more?

from reagent-cookbook.

gosukiwi avatar gosukiwi commented on August 21, 2024

Yes, this is ok, you can close it. Thanks a lot for your help! 👍

from reagent-cookbook.

gadfly361 avatar gadfly361 commented on August 21, 2024

No problem!

from reagent-cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.