# 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:** 1

<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 2, 2020, 10:52pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/1 "2020-01-02T22:52:59Z")

</div>

After many months of work, @bourgeoa, @A_A , and I are releasing version 1.0.0 of **[Solid-File-Client](https://github.com/jeff-zucker/solid-file-client)**. This library of methods to manage Solid files and folders now has the ability to copy or move entire folder trees from one pod to another or back and forth between a pod and a local file system. It supports both text and binary files and works in either a browser or node/console context. Also new in this version is extensive support for linked resources (.acl and .meta files). By default linked resources are copied, moved, and deleted with their associated resource, but options allow you to adjust that behavior as well as to discover the location of linked resources.

There are a number of changes which are not backward compatible. Users of the old version of Solid-File-Client should see [Transitioning to Version 1.x](https://github.com/jeff-zucker/solid-file-client/blob/master/docs/transition-to-v.1.md).

Here is a complete working node script to upload and download images to and from your current local working directory. Also take a look at the [Browser Upload Demo](https://jeff-zucker.github.io/solid-file-client/docs/examples/) which allows you upload to your pod without even having to install Solid-File-Client.

```javascript
const auth = require('solid-auth-cli') 
const FileClient = require('solid-file-client')
const fc = new FileClient(auth)

const remoteBase = "https://jeffz.solid.community/public/"
const localBase = "file://" + process.cwd() + "/" // current working folder
const local = localBase + "square.png"
const remote = remoteBase + "square.png"
const local2 = localBase + "square2.png"
const remote2 = remoteBase + "square2.png"

async function run(){
    try {
        await auth.login()
        await fc.copyFile( local, remote ) // upload
        await fc.copyFile( remote, local ) // download
        await fc.copyFile( remote, remote2 ) // copy btwn remote locations
        await fc.copyFile( local, local2 ) // copy btwn local locations
    }
    catch(err) {
        console.log(err)
    }
}
run()

```

If you have questions, feel free to ask in the forum or on gitter. For bug reports or feature suggestions, please use github issues and PRs. If you don’t know how to do that, ask! 🙂

Enjoy!

---

<div class="post-metadata">

**Author:** ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)\
**Post date:** [January 3, 2020, 10:34am UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/2 "2020-01-03T10:34:12Z")

</div>

It looks amazing, congrats on the release!

---

<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 3, 2020, 2:11pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/3 "2020-01-03T14:11:07Z")

</div>

Thanks, great work

---

<div class="post-metadata">

**Author:** ![adventure](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/adventure/32/1152_2.png) [@adventure](https://forum.solidproject.org/u/adventure)\
**Post date:** [January 4, 2020, 1:00am UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/4 "2020-01-04T01:00:45Z")

</div>

Jeffz Strikes again! Great Job Jeff!!!

---

<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 5, 2020, 1:46pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/5 "2020-01-05T13:46:43Z")

</div>

I just tried the Browser upload, but it does not work

- Login button does nothing
- Errors occur in the browser console:

```auto
index.js:3 Uncaught ReferenceError: require is not defined
    at index.js:3
(anonymous) @ index.js:3
index.min.js:7 Uncaught SyntaxError: Cannot use import statement outside a module
(index):133 Uncaught ReferenceError: SolidFileClient is not defined
    at (index):133
(anonymous) @ (index):133

```

---

<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 5, 2020, 3:25pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/6 "2020-01-05T15:25:43Z")

</div>

How do I copy ACLs? I tried copying a folder containing a `.acl` file but, it broke the folder and I am now only getting this message:

`Error: Don't know how to parse text/plain yet while trying to parse <https://pod-homepage.solid.community/static/.acl> as text/plain`

---

<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 5, 2020, 3:53pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/7 "2020-01-05T15:53:43Z")

</div>

That is very odd. Can you show me the code that produced that? The .acl was working okay before the copy?

---

<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 5, 2020, 3:54pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/8 "2020-01-05T15:54:08Z")

</div>

Sorry, did the demo at the last minute, I’ll check it.

---

<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 5, 2020, 4:02pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/9 "2020-01-05T16:02:44Z")

</div>

Yes, it worked before, I did:

`await fc.copyFolder(src, target, { merge: 'keep_source' });`

where `src` is a folder on my local file system, containing just a `.acl` file and `target` is a respective folder on my pod.

---

<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 5, 2020, 4:26pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/10 "2020-01-05T16:26:00Z")

</div>

All right , the demo should work again now (on github, haven’t npm’d yet). Looking into the .acl thing.

---

<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 5, 2020, 4:44pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/11 "2020-01-05T16:44:21Z")

</div>

I can not reproduce your .acl problem. I created a folder on my local system, added a single .acl file there (a copy of my public folder’s .acl), copied the folder to my pod using the same command you did and it worked fine. I then recopied over the now-existing folder on the pod and it still worked fine. What was the command which produced the error you showed (Don’t know how to parse text/plain)?

---

<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 5, 2020, 4:49pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/12 "2020-01-05T16:49:01Z")

</div>

The message shows up when opening the folder in the browser. I will prepare a reproducable example

---

<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 5, 2020, 8:57pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/13 "2020-01-05T20:57:04Z")

</div>

I could not reproduce it in a clean setup either and thereby found out, that I had no explicit installation of solid-auth-cli in my project. After installing this, it works now.

Thanks for your support and the great work!

---

<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 5, 2020, 8:58pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/14 "2020-01-05T20:58:18Z")

</div>

Phew! You had me scared. Thanks much for testing and reporting!

---

<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, 12:42pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/15 "2020-01-06T12:42:49Z")

</div>

No worries, I have more 😃

When copying `index.html` to the Pod root I am getting an error

The command:

```auto
await fc.copyFile(
            'file://' + process.cwd() + '/build/index.html',
            'https://pod-homepage.solid.community/index.html'
        );

```

Output:

```auto
b [SFCFetchError]: SFCFetchError Cannot read property 'endsWith' of undefined
    at toFetchError (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:66451)
    at /path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:68384
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async $.copyLinksForItem (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:71869)
    at async $.copyFile (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:70853)
    at async run (/path/to/projet/upload.js:10:9) {
  name: 'SFCFetchError',
  successful: [],
  rejected: [],
  rejectedErrors: [],
  errors: [
    TypeError: Cannot read property 'endsWith' of undefined
        at $.copyFile (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:70642)
        at $.copyMetaFileForItem (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:71019)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async $.copyLinksForItem (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:71869)
        at async $.copyFile (/path/to/projet/node_modules/solid-file-client/dist/node/solid-file-client.bundle.js:8:70853)
        at async run (/path/to/projet/upload.js:10:9)
  ],
  ok: false,
  message: "SFCFetchError Cannot read property 'endsWith' of undefined",
  status: -1,
  statusText: "SFCFetchError Cannot read property 'endsWith' of undefined"
}

```

The actual upload process did work nevertheless. Seems to be a follow up error.

---

<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, 4:13pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/16 "2020-01-06T16:13:55Z")

</div>

OK, thanks, I’ll look into it. Did you have an index.html.meta or index.html.acl in the folder you copied from?

---

<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, 4:20pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/17 "2020-01-06T16:20:19Z")

</div>

No source folder only contains index.html. I tried both copyFile and copyFolder. It works, if I do not copy to the pod root

---

<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, 4:21pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/18 "2020-01-06T16:21:59Z")

</div>

Thanks, I’m guessing it’s some kind of edge case with the pod root.

---

<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:49pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/19 "2020-01-06T17:49:02Z")

</div>

I’ll keep looking for this although it’s cosmetic. If (or should I say when) you find other things, would you mind submitting an issue rather than posting here - makes it much easier for me to track and follow up.

---

<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, 5:56pm UTC](https://forum.solidproject.org/t/announce-much-updated-solid-file-client/2546/20 "2020-01-06T17:56:46Z")

</div>

Yes of course, I just wanted to make sure its a real issue. Will use github from now on.

I think its not just cosmetic, because it throws an exception and will break the regular code flow, i.e. anything that relys on successful copy operation will not execute, though it actually was kind of successful

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