juruen / rmapi

Go app that allows you to access your reMarkable tablet files through the Cloud API
GNU Affero General Public License v3.0
976 stars 106 forks source link

Uploading a pdf with new 1.5 api loses file extension / suffix #253

Open bsdz opened 2 years ago

bsdz commented 2 years ago

When I upload a file with ".pdf" (or ".epub") extension with rmapi's put command it uploads sucessfully but drops the suffix on the server. E.g.

me@myhost:/tmp/rmapi$ ls -l
total 4488
-rw-rw-r-- 1 me me 3281197 Jul 17 20:53 sample.epub
-rw-rw-r-- 1 me me 1309513 Jul 17 20:48 sample.pdf
me@myhost:/tmp/rmapi$ rmapi put ./sample.pdf /
Refreshing tree...
WARNING!!!
  Using the new 1.5 sync, this has not been fully tested yet!!!
  Make sure you have a backup, in case there is a bug that could cause data loss!
uploading: [./sample.pdf]...OK
me@myhost:/tmp/rmapi$ rmapi ls /
Refreshing tree...
WARNING!!!
  Using the new 1.5 sync, this has not been fully tested yet!!!
  Make sure you have a backup, in case there is a bug that could cause data loss!
[f] Quick sheets
[f] sample
[f] existing.pdf

This also means one can't upload two docs with same base name, one being epub and the other being pdf. i.e.

me@myhost:/tmp/rmapi$ rmapi put ./sample.epub /
Refreshing tree...
WARNING!!!
  Using the new 1.5 sync, this has not been fully tested yet!!!
  Make sure you have a backup, in case there is a bug that could cause data loss!
ERROR: 2022/07/17 20:55:40 main.go:19: Error:  entry already exists

edit: I've realised there's a workaround which is to rename the file on the server using the "mv" command.

ddvk commented 2 years ago

I think that is the default behavior by the official apps (extensions get removed)