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

[Feature request] Chunked file upload #23

Closed
Ghoelian opened this issue Aug 20, 2020 · 15 comments
Closed

[Feature request] Chunked file upload #23

Ghoelian opened this issue Aug 20, 2020 · 15 comments

Comments

@Ghoelian
Copy link

It seems that right now, the entire file is being sent through a POST request.

I'm running MyDrive behind NGINX, which means I had to increase the client_max_body_size to be able to upload any kind of larger file. This is of course not a great solution, as this will quickly clog up the webserver when multiple users are trying to upload a file simultaneously.

I think having files be uploaded in smaller chunks would allow for better multi-user performance, as well as just not having to mess with your NGINX, or whatever other reverse proxy, configuration.

@subnub
Copy link
Owner

subnub commented Aug 20, 2020

That is odd, while it does use a single POST request, myDrive will serve up the files in chunks instead of the whole file at once, the file should never be fully loaded into memory, for example I am able to upload 100gb+ files on a server with 1gb of RAM. Although I have not tested myDrive behind NGINX so It could be an issue with both of them in combination. I will have to do some further research on this issue, but could I have more information such as your Node version, ect? Thank you.

@Ghoelian
Copy link
Author

My Node version is 13.14.0, running on a Raspberry Pi 4b on Ubuntu 20.04 64 bit.

@Ghoelian
Copy link
Author

Oh also, I just opened a different issue, #24 . I guess that one might have something to do with this issue then as well.

@subnub
Copy link
Owner

subnub commented Aug 20, 2020

Okay I would try to run the LTS version of Node, before I ran into similar issues when running 13.14 (Specifically on Linux too), try v12 for the best results (NVM can help with this), please make sure to remove and reinstall your node modules before rebuilding and testing.

If after you change your node version and reinstall/rebuild, and you still run into the same issue, It would be very helpful if you could attempt to use myDrive without NGINX and see if the same issue arises.

@Ghoelian
Copy link
Author

I will try this in a minute, thanks for the help. I used v13.14.0 because it says in the guided setup that v13 works best.

@subnub
Copy link
Owner

subnub commented Aug 20, 2020

You're right it does say that in the guide, thank you for bringing that to my attention I need to change that lol. And of course, let me know how it goes!

@Ghoelian
Copy link
Author

I'm running into a different issue now. I can't log in to the account I previously created, it says my login details are incorrect, but I also can't create a new user, as it already exists. Is there any way of clearing the database of users?

@subnub
Copy link
Owner

subnub commented Aug 20, 2020

What is it saying in the terminal when you attempt to log in? Like not the client side inside the terminal it should be displaying some type of error

And the easiest way to clear data would be just to change the mongoDB url at the end, there’s currently no way to clear all user accounts.

@Ghoelian
Copy link
Author

Ghoelian commented Aug 20, 2020

Ah I see what the issue is here. It's sending a request to drive.mytld.com/drive.mytld.com/user-service/login, which results in a 404 from NGINX. I'm guessing this has something to do with the REMOTE_URL, but I'm not sure why it would change behaviour all of a sudden now that I'm on v12.

Edit: It is not caused by REMOTE_URL, changing this to just / doesn't change anything for the login.

@subnub
Copy link
Owner

subnub commented Aug 20, 2020

Make sure your client URL is the correct format, it needs to be like so http://myDrive.com , make sure it starts with http/https, and also that it does not end in a / or anything like that.

@subnub
Copy link
Owner

subnub commented Aug 20, 2020

Don’t forget to rebuild after changing environment variables

@Ghoelian
Copy link
Author

Changing the env variable and rebuilding seems to have fixed that problem. Trying the file upload now.

@Ghoelian
Copy link
Author

Downgrading to Node v12.18.3 seems to have fixed the file uploading problems as well. I still need to increase the client_max_body_size in NGINX, but after doing that I am able to upload the larger files.
Thanks for helping me figure this out!

@subnub
Copy link
Owner

subnub commented Aug 21, 2020

You’re very welcome! Thank you for having an interest in myDrive, stay updated a big update including a complete UI overhaul is coming soon.

@Ghoelian
Copy link
Author

Ooh very nice! Definitely looking forward to that.

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

No branches or pull requests

2 participants