Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypting a file as a string removes the line breaks #19

Open
thahgr opened this issue Apr 7, 2022 · 0 comments
Open

Encrypting a file as a string removes the line breaks #19

thahgr opened this issue Apr 7, 2022 · 0 comments

Comments

@thahgr
Copy link

thahgr commented Apr 7, 2022

Hello, I am trying to use your library to encrypt some csv files.

First I transform the file to a string. Maybe this approach is wrong.

  • I am doing MultipartFile file to get the file from a Rest request
  • content = new String(file.getBytes());
  • then encrypt and store
  • retrieve and decrypt,
  • return the file by content.getBytes()

The encryption and decryption work fine!!

However, during this process the csv seems to loose the line breaks and all comes as one line

Do you have any suggestions on how to tackle this problem ??

ps I have checked that just by uploading file, encoding to string, then decode it and return as a file maintains all line breaks, so I figure the encoding must play some role

@thahgr thahgr changed the title Encrypting a file removes the line breaks Encrypting a file as a string removes the line breaks Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant