# Announce : much updated Solid-File-Client

**URL:** <https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546>\
**Category:** General Discussion\
**Created:** [January 2, 2020, 10:52pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546 "2020-01-02T22:52:59Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 6, 2020, 5:59pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/21 "2020-01-06T17:59:26Z")

</div>

Yes, you’re right, it isn’t entirely cosmetic though it doesn’t prevent copying. From what I can see, it only applies to index.html in the pod root. I haven’t seen it with any other file in the pod root or with index.html in other containers.

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 6, 2020, 6:00pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/22 "2020-01-06T18:00:43Z")

</div>

Yes, wierd. I am going to investigate myself. Perhaps we can fix it together

---

<div class="post-metadata">

**Author:** ![Leoudayan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/leoudayan/32/763_2.png) [@Leoudayan](https://forum.solidproject.org/u/Leoudayan)\
**Post date:** [January 7, 2020, 1:54pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/23 "2020-01-07T13:54:20Z")

</div>

Thats awesome thanks for this @jeffz.

I tried to use the demo but i am getting following error when i tried to upload file or copy.

SFCFetchError 403  
[https://mano.solid.community/public/Version.docx](https://mano.solid.community/public/Version.docx) - Make sure that the user has access to the resource

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 7, 2020, 2:02pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/24 "2020-01-07T14:02:53Z")

</div>

A 403 is an unauthorized origin error. Have you given your app trustedApp status in your profile? I’m changing the error message for 403 to “Make sure that the origin of your app is authorized for your pod”

If you are using the online demo, you’ll need to authorize the origin [https://jeff-zucker.github.io](https://jeff-zucker.github.io) (no trailing slash)

---

<div class="post-metadata">

**Author:** ![Leoudayan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/leoudayan/32/763_2.png) [@Leoudayan](https://forum.solidproject.org/u/Leoudayan)\
**Post date:** [January 7, 2020, 3:25pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/25 "2020-01-07T15:25:47Z")

</div>

Yes! that trailing slash made this error. It works now. Thanks! I am trying to implement a upload function preconfigured with credentials. But getting no session error.

> let credentials = {  
> “idp” : “[https://solid.community](https://solid.community)”,  
> “username” : “Manotest2”,  
> “password” : “password”, // OPTIONAL !!!  
> “base” : “[https://manotest2.solid.community](https://manotest2.solid.community)”,  
> “test” : “/public/fitness/”  
> };  
> const auth = require(‘solid-auth-cli’);  
> const FC = require(‘solid-file-client’);  
> const fc = new FC( auth );  
> let podfolder = “[https://manotest2.solid.community/public/fitness/file](https://manotest2.solid.community/public/fitness/file)”;  
> let local = “/data/web/blck/node/solidblcn/solidbcn/temp/file”;
> 
> console.log(“Initialising solid login”);  
> let session = await auth.currentSession()  
> if (!session) { session = await auth.login(credentials) }  
> console.log(`Logged in as ${session.webId}.`)  
> try {  
> await auth.login()  
> console.log(“actually trying to copy now”);  
> await fc.copyFile( local, podfolder )  
> }  
> catch(err) {  
> console.log(err)  
> }

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 7, 2020, 3:29pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/26 "2020-01-07T15:29:51Z")

</div>

@Leoudayan which version of `solid-auth-cli` and `solid-file-client` have you installed? Ensure to use the latest ones.

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 7, 2020, 3:39pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/27 "2020-01-07T15:39:41Z")

</div>

Looks like you login twice the second time without credentials

---

<div class="post-metadata">

**Author:** ![Leoudayan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/leoudayan/32/763_2.png) [@Leoudayan](https://forum.solidproject.org/u/Leoudayan)\
**Post date:** [January 7, 2020, 3:46pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/28 "2020-01-07T15:46:23Z")

</div>

@aveltens i am uing 2.4.1 latest version of solid auth client and 1.0.1 version of solid file client.

@jeffz even after removing the auth.login part, i am getting the same error. Following is the full log.

> (node:879) UnhandledPromiseRejectionWarning: Error: No session!  
> at Object.currentSession (/data/web/blc/node\_modules/solid-auth-cli/src/index.js:58:18)  
> at Object.exports.upload (/data/web/blc/node/solidblcn/solidbcn/models/exp1.js:77:28)  
> at exports.upload (/data/web/blc/node/solidblcn/solidbcn/controllers/exp1controller.js:15:16)  
> at Layer.handle [as handle\_request] (/data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/route.js:137:13)  
> at Route.dispatch (/data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/route.js:112:3)  
> at Layer.handle [as handle\_request] (/data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/layer.js:95:5)  
> at /data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/index.js:281:22  
> at Function.process\_params (/data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/index.js:335:12)  
> at next (/data/web/blc/node/solidblcn/solidbcn/node\_modules/express/lib/router/index.js:275:10)  
> (node:879) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)  
> (node:879) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

One odd thing i am noticing is that i am getting the following warning near the solid-auth-cli and solid-file-client declaration

> Could not find a declaration file for module ‘solid-auth-cli’. ‘/Volumes/blockchain20.kmi.open.ac.uk/node\_modules/solid-auth-cli/src/index.js’ implicitly has an ‘any’ type.  
> Try `npm install @types/solid-auth-cli` if it exists or add a new declaration (.d.ts) file containing `declare module ‘solid-auth-cli’;

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 7, 2020, 3:49pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/29 "2020-01-07T15:49:33Z")

</div>

> [@Leoudayan](#):
>
> i am suing 2.4.1 latest version of solid auth client and 1.0.1 version of solid file client.

Sorry, I meant `solid-auth-cli`

---

<div class="post-metadata">

**Author:** ![Leoudayan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/leoudayan/32/763_2.png) [@Leoudayan](https://forum.solidproject.org/u/Leoudayan)\
**Post date:** [January 7, 2020, 3:57pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/30 "2020-01-07T15:57:51Z")

</div>

Ah yes!!! i didnt realise that solid-auth-cli and solid-auth-client are different. It worked now!! Once again thanks a lot @jeffz for creating this and thanks both for helping me to fix the issue @aveltens.

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 7, 2020, 6:44pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/31 "2020-01-07T18:44:42Z")

</div>

@aveltens - @bourgeoa found the issue with your index.html error - an NSS bug. Apparently NSS doesn’t send a content-type for index.html in the pod root and Solid-File-Client was erroring when it tried to read its headers for purposes of copying linked files. We’ll trap the error on our end better though, it shouldn’t interfere with copying.

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 7, 2020, 7:02pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/32 "2020-01-07T19:02:05Z")

</div>

Ah, thats great Jeff! Did you file a NSS bug already? Thanks a lot for all your efforts

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 9, 2020, 6:19pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/33 "2020-01-09T18:19:31Z")

</div>

> [@jeffz](#):
>
> Apparently NSS doesn’t send a content-type for index.html

Hi @jeff, I cannot reproduce this.

```auto
curl https://pod-homepage.solid.community/ -I
curl https://pod-homepage.solid.community/index.html -I

```

both return `Content-Type: text/html; charset=UTF-8`

What lead you to the assumption?

The fun(?) thing is: `https://pod-homepage.solid.community/index.html` actually **does not** return the actual index.html file I stored at the Pod root, but the “Solid Data Browser” page 😕

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 9, 2020, 6:20pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/34 "2020-01-09T18:20:44Z")

</div>

I mis-wrote, it returns a content-type, but not a link header. For example, this returns null:

```javascript
const auth = require('solid-auth-cli')
const podIndex = "https://jeffz.solid.community/index.html"

auth.login().then(
    auth.fetch( podIndex ).then( response =>
        console.log( response.headers.get("link") )
    )
)

```

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 9, 2020, 6:22pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/35 "2020-01-09T18:22:46Z")

</div>

> [@jeffz](#):
>
> For example, this returns null

Ah yes, I see. I think this is acutallly related to the fact, that an explicit request of index.html returns the Data browser page and not the actual resource.

I found an issue regarding that behaviour [Requesting index.html from root will serve the data browser, not the file itself · Issue #1345 · nodeSolidServer/node-solid-server · GitHub](https://github.com/solid/node-solid-server/issues/1345)

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 9, 2020, 7:22pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/36 "2020-01-09T19:22:37Z")

</div>

The pod root index.html is an edge case from about three different angles. But we’re fixing Solid-File-Client so that the error you reported is only triggered if you are also trying to copy linked resources.

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 9, 2020, 7:43pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/37 "2020-01-09T19:43:07Z")

</div>

Cool 👍 but copying linked resources is the default, isn’t it? Should it not work even without a Link header? The resource just doesn’t have linked resources in that case?

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 9, 2020, 7:48pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/38 "2020-01-09T19:48:12Z")

</div>

LOL. Take a look at [the lengthy conversation on this issue](https://github.com/jeff-zucker/solid-file-client/issues/125) that Alain, Otto, and I have been having about this exact question. In the end we decided to only error in the case where there is an index.html.acl in the source but no .acl link in the target’s header and the user use the default withAcl=true.

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [January 9, 2020, 7:53pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/39 "2020-01-09T19:53:19Z")

</div>

That sounds reasonable. 🙂

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [January 9, 2020, 8:36pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/40 "2020-01-09T20:36:56Z")

</div>

Implemented in 1.0.2, now on npm. It should no longer show an error in your situation. Thanks for your ongoing help.

[Previous page](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546.md?page=1)

[Next page](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546.md?page=3)
