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

Use XMLHttpRequest for file uploads (PUT method) to show progress indicator #115

Open
Lex-2008 opened this issue Dec 23, 2022 · 4 comments
Assignees

Comments

@Lex-2008
Copy link

Hi!

First, thanks for a nice project! I like how I can have an otherwise static (looking) website but easily turn it into a file manager with a click of a button.

However, I noticed that it lacks any upload progress indicator, which might be an issue when uploading a gigabyte-sized files via not-so-fast connection.

Probably that's because underlying fetch API doesn't support it.

It looks like a suggested workaround is to use "good ol' XMLHttpRequest". In a quick test, I was able to use it to issue a PUT request to upload a file to my webdav server (running nginx) while monitoring progress in console.

What do you think about it? I see that file upload logic is located in a separate file, so it should be possible to change even for me.

Would you be interested in such pull request, or would you prefer to do it yourself?

@dom111
Copy link
Owner

dom111 commented Dec 23, 2022

Hi there,

Thanks for taking interest and raising an issue!

I'd certainly be open to a PR if you have the time!

Hopefully the dev env all makes sense and the tests work 😅

Feel free to assign an issue to yourself and work against that, please ask if you have any questions and if you don't end up having time, I'll try and take a look next time I do.some updates here!

Thanks,

Dom

@Lex-2008
Copy link
Author

I'm not sure I can assign myself to an issue - likely I lack some permissions...

But I played with gitpod - it was very nice and gave me a working env! I just only had to figure out that to rebuild project I have to run make build inside the terminal, and cleanup dist dir - for some reason, it had webdav.css and webdav.js dicrectories, and wasn't writeable for current user.

Anyway, I made it work and created PR: #116 - please let me know what you think about it!

Note that it was my first ever experience in writing TypeScript, so feel free to correct me!

@dom111
Copy link
Owner

dom111 commented Dec 26, 2022

Hey @Lex-2008, this is looking great so far, thanks for the contribution! No concerns over the TypeScript, couple of minor comments but as noted on the PR, if you don't have time/inclination, there's enough there for me to move bits around and merge as time allows.

Thanks again for your time on this!

@Lex-2008
Copy link
Author

Thanks for warm welcome!

It's pretty interesting for me to work on it (new language, new editor, new everything), so I'd like to work on this a bit more - for as long as my gitpod credit lasts, at least :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants