-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Can not upload txt file #46
Comments
Hi @Zengratul, I tested the given scenario, while uploading txt file with this plugin, however was unable to reproduce this behavior. It could be some problem with the REST API, which you are using to upload the file. Could you verify, whether this is not something related with the REST API. It would also help, if you could provide sample app, which could be debugged locally. Regards, |
Dear @tsonevn, You can test with pdf, image files. It works well. Please change directory as my example if your device is not rooted. Thank you, |
Hi @Zengratul,
I am attaching the code from
Could you verify whether you will have the same problem, while using the edited app. It would help if you could also give us more info about the result, which has been expected. Let me know, whether this helps or if I could assist you further. |
Dear @tsonevn, I installed one time again Java SDK and test again but It doesn't worked. I have tested your code on both my Galaxy Tab S2, Galaxy Note 4 and on Genymotion. I placed a file on /data/data/org.nativescript.Test/files/app/files/Text.txt as your code. However, I only receive below error. On my device: [object Object] StackTrace:
And on logcat: Thank you, |
Hi @Zengratul, Let me know, whether this helps. |
Dear @tsonevn, However, image or pdf file, you can build first and add file later, it works well. I tried rename file name of image into Text.txt -> It works well. Please check build code first -> add file Text.txt later -> it will appear errors. And do with image or pdf, it will works, you can set file anywhere to upload, it also works. I think the problem is from body of file and encode binary, not extension of file. Thank you for your reply, |
Hi @Zengratul, Regarding to the topic, changing files inside the Regards, |
Thank @tsonevn for your help, I think the problem: var task = session.uploadFile("file/path/bigpig.jpg", request); The code uploads run before the code select file, it causes error. I try to separate a new variable to select file, and it works well. Sincerely, |
Hi @Zengratul, Indeed the best way is to check, whether the file is available and then to start to uploading the file. Regards, |
I tested with image and pdf file, it's really good. I try to upload a text.txt file with body "AAA", 3 bytes. It happens error as below:
It may upload text file as text/html, not text/plain. In Postman, it works well. Something happens, please help.
The text was updated successfully, but these errors were encountered: