Comments (13)
The feature is on the backlog, the request is pretty clear, so I'll close the issue.
from filepond.
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.
@TweeZz Currently FilePond does not recursively read subdirectories. Added to the todo list.
from filepond.
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.
@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.
- 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 ine.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.
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.
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.
Thanks for the additional details, will look into this further when I get the chance.
from filepond.
@TweeZz Did you come up with a solution to expose the relative path?
from filepond.
@dclemenzi Nope, I did not.
from filepond.
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.
@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)
- [Bug] Wrong name for nb no locale file?
- [Feature] HOT 1
- [Bug] Object literal may only specify known properties, and 'patch' does not exist in type
- Is there a way to change the HTML structure of the item dropped ? HOT 2
- [Bug] accepted filetypes audio on iPhone doesn't work HOT 2
- Changing the size of the button to remove an uploaded photo HOT 1
- [Bug] Invalid file label overflows if many file extensions are supported HOT 3
- Example with transfer(id) on Server advanced process
- [Bug] black image uploaded instead HOT 1
- [Bug] The method getFileEncodeDataURL() stopped working. HOT 1
- [Feature] Prevent video reordering to first position HOT 1
- [Feature] Option to Disable the Remove File Button HOT 2
- [Bug] Please remove the shaking animation.
- [Feature] Customize Animation Duration
- [Bug] [react-filepond] State update in onremovefile event handler triggers file re-upload HOT 2
- [Bug] url.split is not a function when attempting to load "local" images (React 18) HOT 6
- Converting Headers key to CamelCase? HOT 1
- Bootstrap 5 image preview as gallery [Feature] HOT 2
- [Feature] How to show file limits to a custom html area with a selector HOT 5
- filepond--list-scroller overlays other elements [Bug] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filepond.