Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload dir #853

Closed
wants to merge 4 commits into from
Closed

Upload dir #853

wants to merge 4 commits into from

Conversation

GrosSacASac
Copy link
Contributor

@GrosSacASac GrosSacASac commented Apr 26, 2022

Allows to upload directories and keep their structure with on the client side

<input type="file" name="folder" webkitdirectory directory>

Add a new options createDirsFromUploads that will create necessary directories from filename before uploading process.
For example if "a/b.txt" is sent in from the browser

then uploads folder will be uploads/a/b.txt

@GrosSacASac GrosSacASac added Status: In Progress This issue is being worked on, and has someone assigned. Type: Enhancement Most issues will probably be for additions or changes. Expected that this will result in a PR. labels Apr 28, 2022
@GrosSacASac
Copy link
Contributor Author

GrosSacASac commented Apr 30, 2022

@Akxe and @wbt please review, if it looks good I will add a few automated test and then merge

@GrosSacASac
Copy link
Contributor Author

Has to be used with filename option (otherwise hexoid creates a flat random name)

@tunnckoCore tunnckoCore added the Area: files Things related to handling files, names, etc. label Apr 30, 2022
src/Formidable.js Show resolved Hide resolved
@wbt
Copy link
Collaborator

wbt commented Apr 30, 2022

Well I feel a little silly for having recently spent a bunch of time implementing something similar outside Formidable.
I haven't done any testing on the proposed code and see it's failing the existing automated tests, which seems concerning. I didn't spot any red flags in a quick pass through the code, but would likely want to see tests passing before I would recommend a merge.

@GrosSacASac
Copy link
Contributor Author

Thanks for the input, some tests are failing but they failed before it has nothing to do with this change. There is an issue open about failing tests I think which I would try to handle after this PR.

@Akxe
Copy link
Collaborator

Akxe commented Apr 30, 2022

I am not sure about everything being sync fs operations.

From TS point of view, it does not change much...

Finally shouldn't there be some FS error handling? Does the form processing need to stop, because of an error in saving a file?

@GrosSacASac
Copy link
Contributor Author

Closing in favor of #855 please have a look there

@GrosSacASac GrosSacASac mentioned this pull request Dec 1, 2022
@GrosSacASac GrosSacASac deleted the upload-dir branch June 16, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: files Things related to handling files, names, etc. Status: In Progress This issue is being worked on, and has someone assigned. Type: Enhancement Most issues will probably be for additions or changes. Expected that this will result in a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants