Happy Hacking and welcome to Freenet, the forgotten cypherpunk paradise where no one can watch you read!
The immutable datastore in Freenet provides the basic structures for implementing distributed, pseudonymous, spam-resistant communication protocols. You all know how this works in torrents and file hosters: You generate a link and give that link to someone else.
But until now there was no practically usable documentation how to use them. To create that link, you have to know the exact content of the file beforehand.
Every new developer had to find out about them by asking, speculating and second guessing the friendly source (also known as SGTFS). Get it from Freenet We will not go into special cases. as prefix, and they can even click it - if they run Freenet on their local computer or have an SSH forward for port 8888.
The code above only returns once the file finished uploading.