I use the following code to upload a local file to pCloud:
apiClient = ...
File file = new File("test.txt");
System.out.println("FILESIZE: " + localFile.length());
RemoteFile uploadedFile = apiClient.createFile(
RemoteFolder.ROOT_FOLDER_ID,
localFile.getName(),
DataSource.create(localFile))
.execute();
System.out.println("UPLOADED: " + uploadedFile.size());
This code works fine, as long as the text file does not contain a line starting with '----'.
For example the following text:
Transmission Control Protocol
Functional Specification
Currently defined options include (kind indicated in octal):
Kind Length Meaning
---- ------ -------
0 - End of option list.
1 - No-Operation.
2 4 Maximum Segment Size.
Specific Option Definitions
End of Option List
Uploading this file gives the following output:
FILESIZE: 348
UPLOADED: 149
and looking at the uploaded text it stops before the first line starting with "----":
Transmission Control Protocol
Functional Specification
Currently defined options include (kind indicated in octal):
Kind Length Meaning
So lines starting with four "-" signs are somehow misinterpreted as End-Of-Text.
I use the following code to upload a local file to pCloud:
This code works fine, as long as the text file does not contain a line starting with '----'.
For example the following text:
Uploading this file gives the following output:
and looking at the uploaded text it stops before the first line starting with "----":
So lines starting with four "-" signs are somehow misinterpreted as End-Of-Text.