Sorry, victorgon of course, as shown in the screenshot
The fact that this script fails for you means that the problem is not in your app, rather on the server or on the permissions for you and your app. I notice that the 403 error is for the folder not the file. Make sure that you have sharing permissions for both the file and the folder it is in. If you are sure that both the folder and the file have open permissions and that the app is trusted, then the only remaining answer is that there is a server bug. Go to the node-solid-server page on github and file an issue listing what perms you have set, what you tried, and the fact that it gave a 403.
OK, I actually got to upload the file to @uo264074 's POD. However I have some issues that I will comment here:
- The statement I execute is fc.postFile( targetUrl + fileName, this.state.route, “text/plain”);, creates the file correctly, but it adds the extension “.txt” to the file, f.i, the file called test.json would appear in the POD as test.json.txt, and I would like to remove the “.txt” part.
- Is there any possibility to create a folder with Everyone as a Poster, without having to do it in the solid provider itself?
Thank you for all the answers by the way, we appreciate the help a lot.
So what got it to work? Others can learn from your experience only if you tell us what finally worked.
In terms of the extension - you should probably always supply one as part of the name. You should always define the content-type correctly. For json files , that would be “application/json”.
@Smag0 originally, yes - they were using PUT, but then they switched to POST and it still didn’t work. But something changed and now it works.
@AdrianPerezManso you can use solid-file-client.createFolder() to create the folder but currently AFAIK the only way to set permissions on it is using the databrowser. You could manually edit the .acl file but be very careful - a simple error in the .acl file can make the entire folder inaccessible to you and you will not be able to see or delete it.
I’m not sure but I think that the reason it didn’t work is because we were giving Submitter permissions, and not Poster permissions. So the things I had into account to make this work are the following:
- Giving all possible permissions to the application (in my case localhost)
- Giving Poster permissions for the user/group by whome you want to create the file
- Using POST method instead of PUT method to create a file in another one’s POD
I don’t know which of these requisites are totally mandatory, but at least is the configuration that made it work for us.
Using the “application.json” the file appears like these:
Can I access the proper content somehow?
I think you did not get my point. I mean that how can I see the content itself? For example this is in my personal POD:
Sure what i said is when it’s on your own POD you have 5 icons near to the name of the file, but on the first, there are only two, the other can be displayed with the developer mode.
But I don’t know if other can see the content, it is a question for databrowser devs i send a ping to gitter where they mostly live
I think you might want to enable the Developer role for yourself to enable more views - check out https://github.com/solid/userguide/#role for how to apply roles to yourself.
You can view json files with the solid-filemanager I’ve made: https://otto-aa.github.io/solid-filemanager/?url=https://victorgon.inrupt.net/public (No need to login for public content). You should also be able to edit/copy/rename/… files with it, though I’m not 100% that everything still works as I don’t check it regularly.
When logged you should be able to post to inbox of your friend but they must grant you/everyone to submitter before Solidarity - first shot for a 🐈
@Smag0, I’m taking a look to this application you just commented. Do you know if there is anyway to use it inside the application, without using the browser?
By the way, I will keep the “application/json” format, despite the fact it is not shown as text mode, because our application parses perfectly the content.
It can be included in any app just use the solid databrowser to grant the rights of your inbox (if you want that I can respond to you;-)
Then add me to your friends ( https://spoggy.solid.community/profile/card#me ) and you should be able to post to my solid inbox. Now I’m going to eat but I will respond to you soon after… And you should see in the app, the same message that you will find in your inbox folder. You can also try with all of your friends
I don’t know which permissions I have to give of inbox. I also already added you, and I think I’m able to send you a message, but I tried with @uo264074 and did not work. I suppose it is related with the inbox permissions