-
Notifications
You must be signed in to change notification settings - Fork 159
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 file using SDK instead of XHR #2239
Conversation
@LukasHirt @DeepDiver1975 please have a look at this POC and also the linked dependencies in owncloud-sdk and let me know if this is ok before I continue applying the changes to the public upload. I intend to delete FileUpload.js (but not FileUpload.vue) and later on we can implement chunking inside of owncloud-sdk: owncloud/owncloud-sdk#18 |
💥 Acceptance tests XGAPortrait failed. Please find the screenshots inside ...https://drone.owncloud.com/owncloud/phoenix/5702/
|
💥 Acceptance tests iPhone failed. Please find the screenshots inside ...https://drone.owncloud.com/owncloud/phoenix/5702/
|
@@ -1,6 +1,5 @@ | |||
import filesize from 'filesize' | |||
import moment from 'moment' | |||
import FileUpload from './FileUpload.js' |
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.
can we delete FileUpload.js?
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.
yes, when I'm done. See TODO list in top post
also we need to talk about "loadend" now (see conflict), I'm still not convinced that we need it. |
seems loadend also fires after an error: https://humanwhocodes.com/blog/2012/05/22/working-with-files-in-javascript-part-3/ |
more trouble: uploading into subdirs doesn't work because all the upload code assumptions so far was about using the full URL as prefix. this means we need to change many places to use the current folder for its path. This changes the paradigms a bit...
|
I managed to fix the subdir upload but I'm now blocked as I can't test public upload: need #1951 first |
note: acceptance tests to be added as part of ticket #2222 |
Exactly, that's what I mentioned here #2225 (comment) and why I used it at all. |
Anyway, like a lot the approach to move it into the sdk 👍 |
878ef46
to
38e8c7e
Compare
I've fixed the public link upload. I find some messy stuff there like the token sometimes being embedded in the path... I'll raise a separate ticket to address this debt as I'd prefer to have more transparency there where the file list components don't need to care about public or not. This might affect how SDK API is designed.
|
|
38e8c7e
to
54521b0
Compare
all done. I did a quick run of some upload tests locally and they passed. let's see if the whole suites run... |
💥 Acceptance tests SharingInternalUsers failed. Please find the screenshots inside ...https://drone.owncloud.com/owncloud/phoenix/6469/
|
|
Fixed files drop case. Glad to see that this could be caught by acceptance tests! |
54521b0
to
42db901
Compare
@LukasHirt all green in CI, just some bug that prevented it to appear published on Github. Can we merge ? |
|
Use owncloud-sdk for uploading files for both the regular file view and also public page. Removed FileUpload.js as it is now obsolete. Had to switch to using paths instead of URLs in the upload handlers. There were some challenges because the public link page currently has the token embedded into the absolute path. Introduced dependency on join-path to avoid more path gymnastics in various places.
42db901
to
52f644a
Compare
Fixed drag and drop bug. It turns out that vue-dropzone needs a URL even though we don't use that functionality. I've fed it a dummy URL for now. To be cleant up in #1953 |
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.
🚀
One CI job got stuck on cloning. Restart build. |
Description
Use owncloud-sdk for uploading files
Related Issue
None raised
Motivation and Context
As we'll add chunk upload later to the SDK, it makes sense to use the SDK for upload instead.
It will only be a matter of adding "maxChunkSize" to the options to have it using chunks.
I don't think we should implement chunking directly in Phoenix.
Also: as we use the SDK in other places we should be consistent and use it everywhere!
How Has This Been Tested?
Quick manual test with a file upload:
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: