Giter VIP home page Giter VIP logo

Comments (8)

cannikin avatar cannikin commented on May 16, 2024

Yes, we'll have an image uploader in the https://github.com/hammerframework/example-blog project soon!

from redwood.

cannikin avatar cannikin commented on May 16, 2024

Hello! We've got image uploading in our example blog. We're using https://filestack.com for uploads since they give you a really nice uploader and you don't have to provision storage anywhere. You get 100 uploads per month for free.

If you take a look at our usage it's pretty simple: initialize their widget and attach it a DOM element on your page (lines 98-114). There are tons of options for the picker.

Our custom behavior is that if the user already has an image attached to a blog post then we display that (line 116) and hide the uploader (line 113), along with a button to replace the existing image (lines 121-127) which just shows the picker again. Whether the image is set or not is kept in local component state (lines 21, 33, 39).

Once the upload is complete we take the URL given to us by Filestack and add that to state so that the image appears in place of the picker, and then on submit we append that URL to the object containing the rest of the data in the form (line 26).

Let us know how that looks and if it was anything like you were expecting! :)

from redwood.

zwl1619 avatar zwl1619 commented on May 16, 2024

Thanks very much, that is awesome, I like it.
And one more thing, storing images on external cloud server and in my project server's local path, both are useful to me. So could show how to upload an image to a local path of the project server?

from redwood.

cannikin avatar cannikin commented on May 16, 2024

We're really focusing on making Hammer great for the JAMstack, which means you won't have any server to save images to! But, Hammer is still using regular ol' React so anything that works for React will work here as well. For example: https://www.signet.hr/file-upload-with-node-react/

from redwood.

santoshgistto avatar santoshgistto commented on May 16, 2024

@cannikin is possible to link firebase storage ?

from redwood.

cannikin avatar cannikin commented on May 16, 2024

Hi @santoshgistto I'm not familiar with firebase storage, could you tell me more about it? If they have an API then you should be able to pull it in and display in a Redwood app!

from redwood.

santoshgistto avatar santoshgistto commented on May 16, 2024

@cannikin yes they are having apis

Firebase provides admin sdk
Capabilities: may be suitable fo redwood

  1. Authentication : https://firebase.google.com/docs/reference/admin/node/admin.auth
  2. firestore : https://firebase.google.com/docs/reference/admin/node/admin.firestore
  3. storage https://firebase.google.com/docs/storage/admin/start
  4. firebase extensions : This will be helpful when image gets uploaded for generating thumbnail https://firebase.google.com/products/extensions/storage-resize-images
  5. Web push notification : would be helpful if running static page needs refresh.

from redwood.

cannikin avatar cannikin commented on May 16, 2024

Have you seen the File Uploads cookbook recipe? That might give you a starting point to try integrating Firebase storage!

from redwood.

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.