https://bugzilla.wikimedia.org/show_bug.cgi?id=32426
Web browser: ---
Bug #: 32426
Summary: SF needs to check for file existence to prevent
replacing existing file using upload function
Product: MediaWiki extensions
Version: any
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: SemanticForms
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 9456
--> https://bugzilla.wikimedia.org/attachment.cgi?id=9456
For context
This is also a shortcoming of the standard MediaWiki upload system, but SF
seems to be better designed and more capable of resolving the problem in its
own way. This enhancement/bug may be related to this one:
https://bugzilla.wikimedia.org/show_bug.cgi?id=30537
Uploading a file with the same name as an existing file will not only replace
the existing file, but also any form data submitted will replace the existing
semantic data too. SF could benefit from the ability to check for the existence
of a file before setting to overwriting existing files and their data. It would
also be helpful if SF could automatically rename the file when creating a new
file page.
For right now, the best workaround I could come up with is to use the default
file name parameter, like this:
default filename=image {{#time: U | now}}.jpg
Obviously, that only works for JPEGS, and will create a new problem for users
who are uploading PDF's or whatever. But, automatically renaming the file with
a timestamp does at least help to ensure the name is unique, although it
doesn't ensure it.
Comment from (updated) form text:
<!-- Files and semantic data will be overwritten if file name is not unique.
Must use the default filename parameter with a timestamp to ensure (but not
guarantee) the file name is unique. No way to automatically detect and append
file extension, so creates new problem for users not uploading a JPEG. They
will get a warning about mime type not matching file extension, and they will
have to figure out the correct extension for themselves. --><nowiki />
If I remember correctly, the file is not actually saved yet when the warning is
produced, so SF doesn't fail on the warnings like it does in this bug report:
https://bugzilla.wikimedia.org/show_bug.cgi?id=32425
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l