Linking to files on Safe Network

I was curious, if you are the only person capable of accessing your data on the Safe Network, is it possible to send a link of for instance a file you stored to someone else on the Safe Network?



Yes, send them the datamap and you effectively sent them the file


This is an important point, everyone has access to all data. some is encrypted though and unknown as to what the encrypted type is. So a link is only going to give folks the content, you also need to give them the ability to decrypt the content. i…e private shared data means both parties must know the “secret” required to read it, then as a further thought. There is a difference between reading data and manipulating it. So a “secret” to read data is not necessarily the same as the “secret” required to change it.

Then of course you have multisig and whilst not activated it brings a lot of additional opportunities for structuring access and edit permissions.

Hope that helps


you could also publish it on a service, such as safe://myservice.mypublic_id/myfile.suffix. Either on your own with the safe web hosting manager, or using a specialized one click app to publish the file and create the link for you, like safeshare used to ( I hope to revive it soon on alpha2 )


@nice I’m expecting that option would be public - secure through obscurity perhaps?


yes this would be public so if someone tries every possible url they may find it. just like a pastebin link.

1 Like

Thx for clarifying David!


@nice maybe you or I, or somebody (I’d be happy for anyone to pick this up!) should take a look at the latest SAFE DOM API and see if it isn’t possible to write a Web App that can take a url parameter and use it to deliver an arbitrary public file to SAFE browser.

Say, the URL is the Web app url, followed by # and then the xor name for an immutable file (data map), plus the file type (. PDF,. HTML,. TXT etc). The Web app takes that, and uses the API to get the data via the SAFE DOM.

We then need a way to spoof it into the browser for display or Save. Not sure if that is possible @joshuef?

What do you think? Fancy having a go? It would be a very useful feature until the browser can do this natively.


sure, this is how safeshare used to work : POC : Introducing SafeShare, a file sharing and pasting webapp
Basically I took the code from Up1 : ( you can try it live on :

Back then it created a service and public Id for each file you uploaded ( as a workaround because we didn’t have mutables ) , and it spat a url like safe://safeshareQDFG645F.SQ6GSDRG5Zqsdrf"'3454 that you could send to anyone.
When opening the url in the browser, you could either download it as file with the correct extension ( really , just like Up1 does ) or have it displayed by the browser if the file type was supported.

I suppose it would be not too complex and really cool to port it to alpha2, and have it work like you said , so it could create links like :

safe://safeshare/45GKert’455RTGdf.pdf or whatever .

1 Like

I think the main thing is not to have to use a public id and service, just a raw reference (eg the xor name), so that any existing immutable file can be shared (and no need to upload again). Is that feasible then?

oh I see what you mean now -it would be linking to existing data.
That would indeed be cool. I am not sure where from and how we get the xor name though . Wouldn’t we need an app that gives it to us at upload time ?

Using safeNfs you can get a file handle, and from that the file metadata which includes the xor name. So that allows you to share an existing file using the datamap name. Once you have that, can you make a Web App that gets the browser to download that? And tell it the file type?

oh yes : you browse your file from within the browser, right click and get a link.

I feel sure that this could work, but it would need that the file is public I presume.
File type derives from the name ?

My question is can you get the browser to treat data accessed via the API, as if it was clicked by the user - you need to do this if you are to avoid creating a public id/service with a link to the file.

maybe somthing like : use the return of readAsDataUrl to feed the href of a download button ? just thought of this instead of sleeping :slight_smile: will try tomorrow

EDIT : createObjectURL seems to be the correct thing


If that’s the case I think this will work. Cool! If you test it please let me know, and I will do likewise. I’m working on other stuff for now but I need this feature so will get back to it at some point. Sorry if you lost some sleep - creativity is like that though huh? ! :slight_smile: