Can't upload file to Google Drive

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
JardaSX
Junior Member
Junior Member
Posts: 27
Joined: 2020-04-04, 23:27 UTC

Can't upload file to Google Drive

Post by *JardaSX »

I have a folder on my LG G8 ThinQ, it's "/storage/emulated/0/SmsContactsBackup/apks/", where SmsContactsBackup backups apks installed on your phone.
Selected all to copy/move to my Google Drive, all files were copied/moved except this one:

Stock_Markets_4.1.apk | 16.7 MB

Code: Select all

  File: Stock_Markets_4.1.apk
CRC-32: b0ed3677
   MD4: d6ebc7427fa7be6c7dba327ca612b3bc
   MD5: 0e9b2c5a19a2e1c89f55bd46ef85f714
 SHA-1: 36cf8e6b295ffe64e9c20972d053fd471eba6b2e

Code: Select all

Write error
Error writing to target file!
//drive/myaccount/LG G8 ThinQ/SmsContactsBackup/apks/Stock Markets_4.1.apk!
Screenshot:
Image: https://i.imgur.com/MoudJxD.png

Operating system: Android 9 stock LG
Total Commander: version 3.0b19 version code 484
Totalcmd-Drive: version 2.10 version code 21

I've tried from other Samsung phone and works fine (has android 10 but same versions of TC and plugins).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Can't upload file to Google Drive

Post by *ghisler(Author) »

No problem here uploading the file to Google Drive. Do you see anything in the log? You can create one like this:

1. Switch to the internal SD card by going to the home folder, and then tap on the first entry in the list
2. Create a new folder named .TotalCommander including the dot at the beginning (if it doesn't exist yet)
3. You may need to enable the display of hidden files in the TC configuration if you cannot see that folder.
4. Go inside this folder .TotalCommander
5. Create a new file named log.txt by holding down a finger on the first line (..)
6. Close Total Commander via "X" button and restart it
Author of Total Commander
https://www.ghisler.com
JardaSX
Junior Member
Junior Member
Posts: 27
Joined: 2020-04-04, 23:27 UTC

Re: Can't upload file to Google Drive

Post by *JardaSX »

Ok here is the log. Tried to copy twice "Stock Markets_4.1.apk" and failed. Then copied "my file.txt" and succeeded. The problem is with the space in filename which generates a newline and the space in between is eaten.

Code: Select all

2020-04-18 00:30:58.107 HOST:drive:initiate connection to plugin
2020-04-18 00:30:58.120 HOST:drive:bindService succeeded
2020-04-18 00:30:58.129 HOST:drive:WaitUntilConnected:Background
2020-04-18 00:30:58.138 HOST:drive:Service connected!
2020-04-18 00:30:58.141 HOST:drive:get dir: /
2020-04-18 00:30:58.143 drive:LIST /
2020-04-18 00:30:58.166 HOST:drive:checkConnectionAlive: 1
2020-04-18 00:30:59.116 drive:open /JardaSX
2020-04-18 00:30:59.236 HOST:drive:get dir: /JardaSX/
2020-04-18 00:30:59.238 drive:LIST /JardaSX/
2020-04-18 00:31:11.613 drive:GET /  (57)
2020-04-18 00:31:11.615 drive:CONNECT JardaSX
2020-04-18 00:31:21.468 drive:MODE I 
2020-04-18 00:31:21.469 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:31:21.474 drive:LIST /JardaSX/temp2/
2020-04-18 00:31:21.796 drive:GET /temp2/  (4)
2020-04-18 00:31:25.982 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:31:25.984 drive:LIST /JardaSX/temp2/
2020-04-18 00:31:26.405 drive:GET /temp2/  (4)
2020-04-18 00:31:26.407 drive:PUT /JardaSX/temp2/Stock
Markets_4.1.apk
2020-04-18 00:31:27.850 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:31:27.851 drive:LIST /JardaSX/temp2/
2020-04-18 00:31:28.151 drive:GET /temp2/  (4)
2020-04-18 00:31:41.928 HOST:drive:get dir: /JardaSX/
2020-04-18 00:31:41.934 drive:LIST /JardaSX/
2020-04-18 00:31:42.717 drive:GET /  (57)
2020-04-18 00:31:45.864 HOST:drive:get dir: /JardaSX/temp/
2020-04-18 00:31:45.871 drive:LIST /JardaSX/temp/
2020-04-18 00:31:46.478 drive:GET /temp/  (21)
2020-04-18 00:35:20.792 HOST:drive:get dir: /JardaSX/
2020-04-18 00:35:20.795 drive:LIST /JardaSX/
2020-04-18 00:35:21.542 drive:GET /  (57)
2020-04-18 00:35:23.374 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:35:23.376 drive:LIST /JardaSX/temp2/
2020-04-18 00:35:23.873 drive:GET /temp2/  (4)
2020-04-18 00:35:39.489 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:35:39.492 drive:LIST /JardaSX/temp2/
2020-04-18 00:35:39.749 drive:GET /temp2/  (4)
2020-04-18 00:35:39.751 drive:MKDIR /JardaSX/temp2/apks
2020-04-18 00:35:43.126 HOST:drive:get dir: /JardaSX/temp2/apks/
2020-04-18 00:35:43.128 drive:LIST /JardaSX/temp2/apks/
2020-04-18 00:35:43.840 drive:GET /temp2/apks/  (0)
2020-04-18 00:35:43.842 drive:PUT /JardaSX/temp2/apks/Stock
Markets_4.1.apk
2020-04-18 00:35:50.429 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:35:50.432 drive:LIST /JardaSX/temp2/
2020-04-18 00:35:50.804 drive:GET /temp2/  (5)
2020-04-18 00:35:52.728 HOST:drive:get dir: /JardaSX/temp2/apks/
2020-04-18 00:35:52.732 drive:LIST /JardaSX/temp2/apks/
2020-04-18 00:35:53.153 drive:GET /temp2/apks/  (0)
2020-04-18 00:35:59.785 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:35:59.788 drive:LIST /JardaSX/temp2/
2020-04-18 00:36:00.220 drive:GET /temp2/  (5)
2020-04-18 00:36:02.476 HOST:drive:get dir: /JardaSX/temp2/apks/
2020-04-18 00:36:02.478 drive:LIST /JardaSX/temp2/apks/
2020-04-18 00:36:02.706 drive:GET /temp2/apks/  (0)
2020-04-18 00:36:02.707 drive:DELETE /JardaSX/temp2/apks/
2020-04-18 00:36:03.454 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:36:03.456 drive:LIST /JardaSX/temp2/
2020-04-18 00:36:04.751 drive:GET /temp2/  (4)
2020-04-18 00:37:38.483 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:37:38.484 drive:LIST /JardaSX/temp2/
2020-04-18 00:37:38.829 drive:GET /temp2/  (4)
2020-04-18 00:37:43.675 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:37:43.676 drive:LIST /JardaSX/temp2/
2020-04-18 00:37:43.938 drive:GET /temp2/  (4)
2020-04-18 00:37:43.940 drive:PUT /JardaSX/temp2/my file.txt
2020-04-18 00:37:45.079 drive:Copied: /storage/emulated/0/.TotalCommander/my file.txt -> /temp2/my file.txt, 4710 bytes, 2.8 kbytes/s
2020-04-18 00:37:45.130 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:37:45.131 drive:LIST /JardaSX/temp2/
2020-04-18 00:37:45.494 drive:GET /temp2/  (5)
2020-04-18 00:37:51.724 drive:DELETE /JardaSX/temp2/my file.txt
2020-04-18 00:37:52.834 HOST:drive:get dir: /JardaSX/temp2/
2020-04-18 00:37:52.840 drive:LIST /JardaSX/temp2/
2020-04-18 00:37:54.195 drive:GET /temp2/  (4)
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Can't upload file to Google Drive

Post by *Usher »

JardaSX wrote: 2020-04-18, 02:54 UTC Ok here is the log. Tried to copy twice "Stock Markets_4.1.apk" and failed. Then copied "my file.txt" and succeeded. The problem is with the space in filename which generates a newline and the space in between is eaten.
So it's not a space there, it's some other character (for example 0x0d or 0x0a). Rename the file to Stock_Markets_4.1.apk (with underscores) and try again.
Andrzej P. Wozniak
Polish subforum moderator
JardaSX
Junior Member
Junior Member
Posts: 27
Joined: 2020-04-04, 23:27 UTC

Re: Can't upload file to Google Drive

Post by *JardaSX »

Ok after investigation, it's not an space, it's "\n". Obviously that was character was introduced by SmsContactsBackup app. Copying with TC to any other folder doesn't work, but renaming does. After that no problem.

However tested with other file managers, and they are able to upload the file to Google Drive "as is" without changing the name. Of course then Google Drive is not able to sync that file to your Windows system, but it's available on your Drive account from the web browser.

Copy with TC not working: Image: https://i.imgur.com/kqsAzKF.png
Two files, one with space and other "\n" instead. You can see that line is split even if filename fits one line: Image: https://i.imgur.com/EiqomNK.png

Code: Select all

judyln:/sdcard/SmsContactsBackup/apks $ ls
Stock\nMarkets_4.1.apk Stock\ Markets_4.1.apk

judyln:/sdcard/SmsContactsBackup/apks $ find . -maxdepth 1 -type f -exec sh -c 'printf "%-10s %s\n" "$1" "$(printf "$1" | xxd )"' None {} \;
./Stock Markets_4.1.apk 00000000: 2e2f 5374 6f63 6b20 4d61 726b 6574 735f  ./Stock Markets_
00000010: 342e 312e 6170 6b                        4.1.apk
./Stock
Markets_4.1.apk 00000000: 2e2f 5374 6f63 6b0a 4d61 726b 6574 735f  ./Stock.Markets_
00000010: 342e 312e 6170 6b                        4.1.apk
Post Reply