Comments (8)
Yes, we'll have an image uploader in the https://github.com/hammerframework/example-blog project soon!
from redwood.
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.
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.
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.
@cannikin is possible to link firebase storage ?
from redwood.
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.
@cannikin yes they are having apis
Firebase provides admin sdk
Capabilities: may be suitable fo redwood
- Authentication : https://firebase.google.com/docs/reference/admin/node/admin.auth
- firestore : https://firebase.google.com/docs/reference/admin/node/admin.firestore
- storage https://firebase.google.com/docs/storage/admin/start
- firebase extensions : This will be helpful when image gets uploaded for generating thumbnail https://firebase.google.com/products/extensions/storage-resize-images
- Web push notification : would be helpful if running static page needs refresh.
from redwood.
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)
- [Bug?]: Build Error "[plugin:vite:esbuild] Transform failed" when Router Page placed in root "web/pages" directory HOT 16
- [Bug?]: fastify server not handling periods in query params HOT 9
- [RFC]: ESM (draft)
- [Bug?]: Cookie created by `yarn rw setup graphiql dbAuth` does not work in graphiql HOT 5
- [Bug?]: Set BigInt scalar to `bigint` in graphQL by default HOT 3
- [Bug]: cannot set jest testTimeout HOT 5
- [Bug]: The gitpod env fails due to wrong node version
- [Bug?]: NODE_OPTIONS in .env file not pulled in correctly HOT 2
- [Bug?]: Developer UX for large applications is poor HOT 3
- feat: Setup GraphQL Trusted Documents with a setup command HOT 2
- [Bug?]: ts/js files placed inside of web/src are getting served instead of serving the proper route HOT 5
- [Docs]: how functions work in a PaaS environments like Render.com HOT 4
- [Docs]: Chapter 5 of the Tutorial uses an old format of Storybook HOT 1
- [Bug?]: `yarn rw test` causes antivirus program to warn me about access to folder on Mac OS HOT 14
- [Docs]: <Set private> is deprecated, used within Router docs HOT 1
- [Docs]: Confusion regarding the SUPERTOKENS_* env variables in generated code HOT 10
- [Bug?]: Generators Cannot read properties of undefined (reading 'startsWith') HOT 5
- [Bug?]: Invalid SDL generated with certain Prisma models that lack editable fields HOT 2
- [Bug?]: Prisma Model with Bytes field fails SDL generation in Service Test template HOT 4
- [Bug]: Cell generation does not support the Custom Prisma Id Field that Scaffolding Supports
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redwood.