kukhariev / ngx-uploadx

Angular Resumable Upload Module
https://github.com/kukhariev/ngx-uploadx
MIT License
43 stars 23 forks source link

custom metadata is not working well #354

Closed ajeecai closed 2 years ago

ajeecai commented 2 years ago

The code looks like this: image

When uploading completed, the onComplete callback in server prints: image

But in some cases, I can see them:

  metadata: [Object: null prototype] {
    ...
   curPath: xxx
   userId: yyy
  },

Is anything wrong?

Thanks

kukhariev commented 2 years ago

Hi! You can see in the first POST request Upload-Metadata header what metadata the client sends (b64 encoded). Are there curPath and userId fields?

ajeecai commented 2 years ago

Hi @kukhariev , I may find out the reason. In some cases I pass curPath with a null string (stands for root dir), then this looks like unacceptable to the server (built with uploadx/core). From the chrome dev tool, we can see curPath and userId is transferred but server doesn't recognize them:

image

Now I pass curPath as '.' then all works well. If it is regarded as not an issue, please close it.

Thanks