-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use stash to upload #860
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
Interesting! I agree that this would be useful, but if we were to take advantage of the "name the file later" benefits, we would need to redesign our upload process I believe? |
I think there a couple of possibilities, with varying scope of changes. I believe the options below will not require UI change (but will require changes to the upload process working in the background). What do you think?
|
Option 1 sounds good to me. What do the others think? :) My concern with Option 2 is, what do we do if the user doesn't complete the process of putting in a title? Currently, that would just mean that the upload doesn't get submitted at all. But if we were to go with Option 2, then if I understand correctly, we would have uploaded a file without any name? Can the file be easily cancelled without needing to go through the Commons deletion nomination process? |
It is a two-stage upload process and in the first stage, the uploaded file will have a temporary name in a temporary space ("stash"), separate from the normal File namespace. If you cancel before finishing the second request, the uploaded material will be gone. At least that's how I understand from the documentation:
|
Working great in my tests. |
Uh oh!
There was an error while loading. Please reload this page.
By using the stash-based upload process available in the MediaWiki API, we can decouple the uploading of the file content from the decision of the file name. This can be great because it reduces the chance of the file name being taken by someone else during a long upload process, resulting in an overwrite. (#228)
https://www.mediawiki.org/wiki/API:Upload has some documentation on it. Also, there is a concise code example in Python: https://github.com/wikimedia/mediawiki-extensions-UploadWizard/blob/e3a24c604c36d01ba24f456ecccca54dfa21d016/tests/api/upload-wizard_tests.py#L52
The text was updated successfully, but these errors were encountered: