How To Share A Link To A File


An App stores files.

It specifies public or private.

How Can It Share A Link To The File?

I asked some related questions on github which @Krishna has given some help with.

This also related to a discussion in the community forum, but I think it belongs here, hence starting this topic.

EDIT: This issue is now being covered in greater depth here.

Early Thoughts

My aim here is to figure out how to offer up a link to a file that is stored by an App and provide s public uri for it. Using the NFS API I think this means:

  • creating a copy that is public
  • creating a service that maps to where those public files are stored
  • generating a URI based on that service and location

I’m guessing there’s alternatives using the all new low level API, but I’m nowhere near understanding that. :smile:

@Krishna maybe the tutorial could show how to do this in both NFS API and low level API?

Oh, and there’s also SafeShare but I think that’s doing something a bit different for now.

EDIT: This issue is now being covered in greater depth here.


Hello !

What SafeShare did ( I hope to update it when I manage to catch back with API changes ) , is creating a service for each file an user wants to store and share. When the user uploads a file, a unique ID is created, and the service created is named after it : http://[the-uid].[the-uid].safenet . This way it is easy to share the link, you just need to send [the-uid] to your friend or whoever, and the when asked for retrieval, safeshare looks into http://[the-uid].[the-uid].safenet

This was an ugly way to cheat with the fact that there was no other option ( that I knew of ? ) at the moment when I wrote it. It pollutes the user’s files with as many services folders as they uploaded files, and I suppose it uses network ressources in an unnecessary way. At least it worked and allowed me to focus on how the Up1 ui worked, and how to adapt it to Safe.

Also, while the SafeShare UI makes it convenient for the end user to manually manipulate files, it does not at all give a way for an application or a program to use a link to a distant file.

My point was primarily - and is still - to learn how Safe works, and to try to build my programming skills to be able to propose something more robust and refined when I progress.

In this sense I am very interested in this thread , to get a better understanding on how file linking is supposed to be done in the future.

Very happy to join this forum too, btw, as I see here a lot of learning material. I lost rails in the last monthes when APIs changed , and had to focus my attention on other aspects of my private life, so I really need to follow all this closely again.

I look forward for applications developer’s tutorials with much interest !

1 Like