I've made a couple of uploads of audio files
When I don't add .ogg to de title of the file, the upload fails.
Since the end of May the app crashes after I've put in a title and description. This wasn't the case back in April, when I was still able to add categories through the app.
Hi @VDK ,
Could you please send us the crash report if possible? When the app crashes it should give you the option of submitting a crash report via email. That will help us diagnose the problem.
Thanks!
I've also had frequent random crash notices pop up since about a month when I'm not actually using the app. I've send in a couple of those.
USER_COMMENT=Wasn't using the app
ANDROID_VERSION=6.0.1
APP_VERSION_NAME=1.13
BRAND=Android
PHONE_MODEL=XT1572
CUSTOM_DATA=
STACK_TRACE=android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:460)
at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:68)
at fr.free.nrw.commons.contributions.Contribution.fromCursor(Contribution.java:218)
at fr.free.nrw.commons.modifications.ModificationsSyncAdapter.onPerformSync(ModificationsSyncAdapter.java:90)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
Thanks @VDK ! Will try to look into it.
Hi @VDK ,
I've looked into your crash report, and released a patch yesterday that should fix the issue.
However, the cause of the crash appears to be unrelated to the .ogg issue. Do the uploads still fail if you don't add .ogg to the title? If they do, how do they fail? Does it just say 'failed' on the main screen, or does nothing happen, or does the app crash etc?
Thanks!
Uploads still fail if you don't add .ogg to the filename yourself. It says fail on the main screen
@VDK: Thanks for the feedback!
I am interested in fixing this bug. But I don't see an option to upload the audio files. When I tried to upload an ogg file the upload failed.

Wikimedia Commons supports wav, ogg and flac audio files. At the moment these files do get uploaded if you add the file extension yourself to the title of the upload, so Indian accent.ogg
I can successfully upload ogg files without adding extension name to the title of the upload. Is issue fixed or just i can upload without problem?
I'd like to take a look into the issue and solve it if it still exists.
OK @deydebaditya good luck, let us know about the situation every few days :-)
@nicolas-raoul Sure thing! :)
Hi, I tried uploading .ogg audio file by both by
putting .ogg extension in title.
without putting extension in the title.
Upload failed in the second case while the upload was successful in the first one.
Can we add an option after the user chooses the file to upload different types of file like it can be a picture, audio file or a video. We can add a drop-down on the UI shown in screenshot attached below. Then, the user can choose the kind and then upload. I think, it can help to fix the issue.

@neslihanturan I am planning to submit a proposal for GSoC on the project idea you are mentoring, and I thought it would be helpful to start working an issue or two. Do you think this issue would be a good starter to familiarize myself with the code?
Since this is beginner friendly, go for it @ilimugur :) But the issue is old, firstly please check if the problem still exists.
@neslihanturan I already have, actually. I built the code on Android Studio and tried uploading an .ogg file using an emulator, but it seems the files (i.e. I tried 2 different ones) look grayed out, and can not be selected for upload. Same thing occurs when I tried using my physical device via the official distribution of the app in the Play Store.
Is there some other way to upload audio files via the app that doesn't use the gallery-browsing interface on the top right corner, or is the feature somehow disabled in the recent versions of the code?
Hey @neslihanturan, would it be alright if I take it up, and try to fix it? As long as it is not already assigned to someone.
I plan to fix this for gsoc_2018 proposal.
@ilimugur did you make any progress? Are you still working on?
@neslihanturan @nicolas-raoul I went ahead and did some investigations, and there is some ambiguity here (perhaps only to me?) about what does adding .ogg to the "title of the file" means.
Case 1: File upload fails when there is no "filename.ogg" in the title text field after the file is selected (but the file selected itself has the extension present) - This does not repro. The upload works fine.
Case 2: The file that is selected is of .ogg format but does not have an extension. The upload does fail here because the existing code cannot figure out the MIME type without any extension and sends a generic "application/octet-stream" to the server which I presume is being rejected.
A possible fix to this would be reading the signature in the file header for the MIME type and comparing it to known signature for ogg (and the like), but I'd like to know if that is a wanted change before I go ahead and attempt it. Are extension-less file uploads a valid use-case for Wikimedia Commons?
Also, I believe @ilimugur 's issue of being unable to select audio files is file-provider dependent. The app only launches the gallery file provider for MIME type "image/* ". I tried adding "audio/ogg", but the stock gallery file chooser on my phone only returns the first (image, in this case) kind of file. I was able to do this with Total Commander which returns any kind of file irrespective of the MIME Type asked for. Since Wikimedia Commons accepts audio files too, perhaps this should be another bug to correctly ask the gallery providers for the MIME Types ("image/* ", "audio/ogg", "audio/wav", etc?)
@neslihanturan Yeah I still am looking to regenerate the issue, but I was having a few technical issues with my OS in the last few days.
@prakhargahlot seems to have hit the spot with the MIME type suggestion. I'll look into extending the MIME types to include audio files in order to regenerate the problem and update this thread, hopefully in less than a day.
Okay, then I will hold off on doing any more work on it for the time being. I suggest you assign the issue (or have someone assign it) to you, @ilimugur if you're working on it.
Since @ilimugur is a first time contributor we can not assign to him, we can only add assigned tag but it is not guaranteed someone added this tag. However, as I wrote previously you can easily see if someone working on it by looking at comments and asking to that person:)
I used Intent.putExtra and Intent.EXTRA_MIME_TYPES to be able to help file managers detect the file formats we are interested in.
It seems to be partially working in a virtual device (API v26 & Android 8.0) as the file manager shows only 1 of the 3 different .ogg files I had as _selectable_. I tried uploading the selectable file with the title "dummy trial" (i.e. without the file extension) and description "dummy description", and it seems to have been uploaded successfully, as can be seen here.
Unfortunately the uploaded file is, to my knowledge, copyrighted, so it will have to be removed asap. That being said, the download did not fail, and I could not regenerate the issue.
As @prakhargahlot noted, the MIME types seem to be the larger issue on which improvements can be made. So, @neslihanturan , unless there are any other ideas as to how I may regenerate this one, I am going to recommend this issue be closed. The MIME type declaration can be handled in a separate issue, and I'd like to work on that one, if that's okay.
Was this ever resolved or is it still being worked on... or still relevant?
Is this issue still opened i would like to fix this issue 馃
Taking off assigned label as not updated for a long time
Taking off beginner friendly because as this issue has been open so long it's clearly not
Going to close as the app doesn't really support uploading audio files properly yet. When it does, if this issue reappears we can reopen. Also I agree with ilimugur's comment on why this should be closed.