How can we upload data from a webpage to an IPFS server? In IPFS, I have already uploaded a .txt/JSON empty file. The file can either be a .txt or a JSON file.
How can we upload data from a webpage to an IPFS server? In IPFS, I have already uploaded a .txt/JSON empty file. The file can either be a .txt or a JSON file.
If i understand your question correctly,you are trying to upload something from your webpage to IPFS cluster(at least this is the basic context i understand). So with this intent i would say this is possible. What you need to do is a. Upload the file in a local IPFS node using the IPFS api(Read the official documentation) and getting the content identifier(cid) from your webpage.
Problem:
Solution:
Use a Pinning service.Pinning is the mechanism that allows you to tell IPFS to always keep a given object somewhere where it is always accessible and save it from the internal Garbage collection that the system performs.
The default pinning location is your local computer node and you can do that using the IPFS specified API. You can also use other pinning service available like Pinnata where you can host the content in their node itself(You scale the number of nodes and you pay!)
In this way you can guarantee that the content is always served and online.
Hope this helps you to get started with.