Repository navigation
Upload autorename on client side - #26078
Conversation
|
@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @mrow4a, @DeepDiver1975 and @butonic to be potential reviewers |
48e79b6 to
76bdaa2
Compare
|
Added unit tests, please review @DeepDiver1975 @butonic @VicDeo |
76bdaa2 to
9d6359d
Compare
|
Rebased, fixed failing test |
9d6359d to
92fa877
Compare
|
Please review @DeepDiver1975 @butonic @SergioBertolinSG @jvillafanez @VicDeo |
|
All tests passed now, Jenkins is back! Please review |
|
|
||
| /** | ||
| * Trigger autorename and append "(2)". | ||
| * Multiple calls will increment the appended number. |
There was a problem hiding this comment.
I don't think this is intended to be called form outside of this class. The usual underscore prefix plus a comment should be enough to make it visible.
There was a problem hiding this comment.
It is called from "outside". The method is on OC.FileUpload.autoRename but is called inside the OC.Uploader object. (yeah, ideally these should all eventually be in separate files to avoid confusion...)
| do { | ||
| retry = false; | ||
| upload.autoRename(); | ||
| // if file known to exist on the client side, retry |
There was a problem hiding this comment.
I think this condition should be in the "while" clause. This loop seems weird to me.
92fa877 to
635bfe8
Compare
| this.log('autorename', null, upload); | ||
| upload.setConflictMode(OC.FileUpload.CONFLICT_MODE_AUTORENAME); | ||
|
|
||
| var retry = true; |
There was a problem hiding this comment.
maybe
do {
upload.autoRename();
} while (this.fileList && this.fileList.inList(upload.getFilename()));
looks better?
635bfe8 to
9823d98
Compare
|
👍 |
Removes the need for POST to collection which would hit against upload limits. The client tries to auto rename the file by adding a suffix "(2)". It tries to use the file list on the client side to guess a suitable name. In case a file still cannot be uploaded and creates a conflict, which can happen when the file was concurrently uploaded, the logic will continue increasing the suffix.
9823d98 to
f99ac40
Compare
|
Removed obsolete PHP tests |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Removes the need for POST to collection which would hit against upload
limits.
The client tries to auto rename the file by adding a suffix "(2)".
It tries to use the file list on the client side to guess a
suitable name. In case a file still cannot be uploaded and creates a
conflict, which can happen when the file was concurrently uploaded, the
logic will continue increasing the suffix.
Related Issue
Fixes #4380 (comment)
Motivation and Context
We don't want to use POST for uploads any more due to PHP size limitations and usage of tmp dir.
The web UI was changed to use PUT for all uploads but the conflict resolution was still using POST.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
TODOs
@DeepDiver1975 FYI