GithubHelp home page GithubHelp logo

Comments (13)

rikschennink avatar rikschennink commented on May 14, 2024 1

The feature is on the backlog, the request is pretty clear, so I'll close the issue.

from filepond.

majortom64 avatar majortom64 commented on May 14, 2024 1

It would be good to be able to send the directory structure as well as the files with data. In other words, if I have this structure:

[startDir]
File1.pdf
File2.pdf
[emptyDir]
[nonEmptyDir]
File1.pdf

It needs to send startDir, emptyDir and nonEmptyDir, not just the files, as the use might want to upload a filesystem structure as well.

from filepond.

rikschennink avatar rikschennink commented on May 14, 2024

@TweeZz Currently FilePond does not recursively read subdirectories. Added to the todo list.

from filepond.

TweeZz avatar TweeZz commented on May 14, 2024

To be able to recreate the directory structure on the server, there will be also the need to not only have the filename, but also the (relative) file path available.
Do you have any idea when such a feature will be implemented?
Maybe, if you could give me some (code) hints, I could have a look at it.

from filepond.

rikschennink avatar rikschennink commented on May 14, 2024

@TweeZz Alright, that makes it a lot more difficult as FilePond would have to show the directory structure on the frontend as well and the server would have to be able to recreate it. This would be super nice but to be honest it's not a top priority right now.

I'm planning to release the source files in the near future, and describe the plugin API in the docs, a feature like this I think would be nice as a plugin instead of a core functionality.

from filepond.

TweeZz avatar TweeZz commented on May 14, 2024

@rikschennink

  • there is code which walks through the directory structure when doing a folder drag'n drop (// the recursive function)
  • when debugging, I noticed that each entry has the relative path information. That info would somehow need to added to the already available properties in e.detail.file. (https://pqina.nl/filepond/docs/patterns/api/file/#properties)
  • I personally don't think it's necessary (for now) to make any changes to the frontend
  • the recreation of the structure server side is not something you should do. The one using your library only needs to get that relative path information. It's up to him to do something with it, or not.

from filepond.

rikschennink avatar rikschennink commented on May 14, 2024

Will look into this.

I do think it's important to be able to see the structure of the directory on the front-end folders could have similarly named files, and it confirms visually that FilePond has parsed the directory structure and is sending that information to the server.

As I'm also offering a PHP solution and plan to add a NodeJS solution I want to make this work on the server as well.

from filepond.

TweeZz avatar TweeZz commented on May 14, 2024

Ok, I understand your argumentation for the front-end changes.

Currently, filepond walks through the directory structure, but it uploads the files in the first directory it bumps into which contains files.
Let me explain.

I drag the 'mainDir'.
When I have the following structure:

[mainDir]
    [subDir1]
        file1.txt
        file2.txt
        [subDir1.1]
            file1.1.txt
    [subDir2]
        file3.txt

then file1.txt and file2.txt will be uploaded.

When I have the following structure:

[mainDir]
    [subDir1]        
        [subDir1.1]
            file1.1.txt
    [subDir2]
        file3.txt

then file1.1.txt will be uploaded.

I think this is because of the following line of code:
if (totalFilesFound === files.length)

I thought I could make it work by kinda collecting all the files (recursively) and then calling resolve(files), but I guess I'm lacking some Promise knowledge. I wasn't able to get it to work.

from filepond.

rikschennink avatar rikschennink commented on May 14, 2024

Thanks for the additional details, will look into this further when I get the chance.

from filepond.

dclemenzi avatar dclemenzi commented on May 14, 2024

@TweeZz Did you come up with a solution to expose the relative path?

from filepond.

TweeZz avatar TweeZz commented on May 14, 2024

@dclemenzi Nope, I did not.

from filepond.

louiselmps avatar louiselmps commented on May 14, 2024

Is it possible to upload a folder that contains multiple files (only files, no subfolders) without having to drag and drop ?? Like selecting a folder and instantly upload the files in it? There is nothing on the documentation for such or maybe i just missed it? @rikschennink

from filepond.

rikschennink avatar rikschennink commented on May 14, 2024

@louiselumapas Files already are added recursively, I think I've forgotten to resolve this issue, latest update also adds relative path info to the file object. fileItem.file._relativePath

from filepond.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.