A great example of how js-ipfs works can actually be found on their homepage, I highly encourage you to check it out: https://js.ipfs.io/
Effectively, you can run a full IPFS node in browser using js-ipfs. I’m going to be working on an example of using js-ipfs to add data in an application context in the near future.
So understanding it’s a full node, you simply need to have the user add the file to their browser js-ipfs node, and from there if you want, you could have the user broadcast the resulting CID of the file to your nodes, and have them pin the CID for some time, which would help re-share the file if the user exits your app.
Typically if you’re not re-initialising IPFS multiple times in the same run, you’ll re-use the same repo. This means when the user returns to your website, the same IPFS repo will load, and they’ll begin re-sharing the file they added once again.
I hope this adds some clarity