-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Upload scan to nextcloud #1068
Upload scan to nextcloud #1068
Conversation
aef81eb
to
ec20d84
Compare
ec20d84
to
fe88dea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only read the code at this stage, I will test it too in the next days
a44e238
to
9b8a1ed
Compare
Tested on my self host nextcloud 30.0.4~ynh2 Pdf upload and image upload (platen multi file) Thanks for this great contribution |
cc0d601
to
d696092
Compare
d696092
to
15ed7e0
Compare
9c85a0e
to
20dee2f
Compare
- Create test for exported nextcloud function; nextcloud reponses are mocked - Skip file upload, if source file not exists - distinguish uploaded file is created or updated - extend logging. Different messages for "Folder not exists" and "User has no permission". Also log other errors - Trim password in password file to remove trailing whitespaces
20dee2f
to
71be807
Compare
@roemerm Please let me know when it's ready on your end so we can merge it with any improvements you'd like to make, if there are still any |
Today I had a problem with line breaks in the password file. At the moment I have no further improvements on this in my mind. If so, I will open another PR. |
if (response.status === 201) { | ||
action = "created"; | ||
} else { | ||
action = "updated"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means you can lose documents because it could erase existing ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weil, actually not. Nextcloud updates an existing file. The last version is directly available in the (web) app. Nextcloud keeps the previous versions, which can be accessed from the web browser
action = "updated"; | ||
} | ||
console.log( | ||
`Document successfully ${action} file at Nextcloud. (Folder: ${uploadFolder}, File: ${fileName})`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, had to read the sentence again to see that. 🙈
Hi,
thank you for your program. 😊
Because adding files to nextcloud via the file system is a bit complicated, I thought that uploading directly to a folder in nextcloud via API call might be easier.
Maybe others are also using nextcloud and now have a more direct way, if this PR is accepted.
I hope it will also work with ADF and/or platten multipage scan. Due to my device does not support this, I was unable to test it.