-
Notifications
You must be signed in to change notification settings - Fork 10
nc.files.download2stream - corupted file bytes #352
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
Comments
Hello.
So if I will place this file inside Nextcloud and use |
the 68b_file_with_one_space_at_the_end.json file is the result after the upload 68b_file.json and add a character anywhere to make the file bigger. The download works before the edit, after adding one more character, it doesn't |
Oh, it is a |
I checked the file. Looks like you are right. |
Should be fixed in |
Describe the bug
I looked into the to_gif example and tried to make a an own app for nextcloud.
After some tests I noticed that "nc.files.download2stream(input_file, tmp_in)" is not working as intended.
I made an own version with downloading JSON files, and noticed the following.
Every file with more than 68B is not working, but if the file is smaller, it works.
68B file:
68b_file.json
68B file with one " " character at the end:
68b_file_with_one_space_at_the_end.json
"nc.files.download(nc_file)" is working as intented
Steps/Code to Reproduce
1.) prepare and start a REST API server for debuging
https://github.com/ynsrc/python-simple-rest-api
I added an function do save bytes in a file.
Download the server.py file and add this functions
2.) download the to_gif example
3.) add "requests" to the requirements.txt
4.) simplify code to only download the file + add debug message
5.) check file in REST API server folder
Expected Results
Downloading the file.
Actual Results
Getting a corrupted file.
Setup configuration
I install the app with an bash file I wrote.
The nextcloud server is in an docker, too.
Version
Nextcloud Hub 10 (31.0.2)
The text was updated successfully, but these errors were encountered: