Invalid URL when uploading file

I always get Invalid URL error when trying to upload a file. I generated an uplink, then tried to upload:

curl -H “Authorization: Token my-token” https://my-private-seafile-server/api2/repos/repo-id-here/upload-link/
https://my-private-seafile-server/seafhttp/upload-api/generated-uplink

curl -H “Authorization: Token my-token” -F file=@/sitemap/1.pdf ‘https://my-private-seafile-server/seafhttp/upload-api/generated-uplink?ret-json=1

{“error”: "Invalid URL.
"}

Any idea?

Adding parent_dir=/ seems resolve the problem.

Hi @hungpham,

where do you add the parent_dir=/ ?
I get the same message “Invalid URL.” if i try to upload a file via seahub (only sometimes). Thanks!