virtualzone/onedrive-uploader

Received unexpected status code 400

wavemoroc001 opened this issue · 10 comments

I have tried to upload file to one drive but it throw Could not upload file: received unexpected status code 400

How can i fix this error ?
@virtualzone

Hi @wavemoroc001, can you provide a bit more information?

  • Are you logged in?
  • Does listing files work?
  • Does creating directories work?
  • Does the error only happen with specific files (i.e. size, file type) or with all the files you've tried?

@virtualzone

  1. Are you logged in?
    I don't sure is my login is successfully ?? (as my screenshot)
    but on console log login successful and got secret.json file

Screen Shot 2565-09-18 at 01 07 28

  1. Does listing files work?
    No, it also throw same error Could not list: received unexpected status code 400

  2. Does creating directories work?
    Nope it throw error Could not list: received unexpected status code 400

  3. Does the error only happen with specific files (i.e. size, file type) or with all the files you've tried?
    In my case, I try to upload image (jpg) that size is less than 1 MB and it blow up with status 400

@wavemoroc001 Thanks for your response. I've just released version 0.4.5 which includes an improved error handling (especially more verbose error messages).

Could you try again with v0.4.5 and post the output? Please also run with the "-v" (verbose) flag.

@virtualzone
I upgrade to version 0.4.5 and still get error.
This is my log

Screen Shot 2565-09-19 at 00 35 16

For more detail

config in app registration
Screen Shot 2565-09-18 at 22 37 10

config.json
Screen Shot 2565-09-19 at 00 53 31

Hi @wavemoroc001 ,

please review your "root" path setting in the config.json. It sets the root path within your OneDrive, not your local drive. Thus, it should usually be set to "/drive/root".

Secondly, please use "/" instead of "." when specifying paths in your OneDrive. So, instead of "ls ." use "ls /" (which is relative to the specified root path, see above).

Please check the README for more information.

Hi @virtualzone
I tried follow your advices but it still get status 400

following this configuration

This is step i use app

Screen Shot 2565-09-23 at 11 34 37

config.json

Screen Shot 2565-09-23 at 11 36 38

This is root dir which i have mapped

Screen Shot 2565-09-23 at 11 33 52

Hi @wavemoroc001,
I hope to have fixed the Dynamic Path Segment Error in Version 0.4.7. Could you try the new version?
However, your "root" path setting is still incorrect. Please use "/drive/root" (nothing to replace here - just copy & paste).

@virtualzone

Oh, thank you so much
I have try till it work.

Screen Shot 2565-09-25 at 01 40 08

@virtualzone Cloud you improve ui screen eg. add estimate time or progress bar ? when i upload large file it look like it freezing

@wavemoroc001 I'm glad it's working now. Thanks for your idea on adding a progress bar/estimated time remaining. I've created a new issue for that (see above).