Moodle Mobile Error {"code":1} when trying to add a file to shared file area

Moodle Mobile Error {"code":1} when trying to add a file to shared file area

by Daniel Tillman -
Number of replies: 3

My students have been using the Moodle Mobile App on their iPads for months now.  They have been successfully uploading files to moodle through the app and submitting them for grading.  I had 2 students get an error popup when they tried to import a .pdf file from Notability to the Moodle Mobile App.  The error was {"code":1}.


I can't find any reference to this error anywhere.  (Maybe I've been searching the wrong places/ways.)  One student made a copy of the file and renamed it and was able to import it over to Moodle Mobile for submission, but then got this error message again when importing a copy of a file that they had already successfully imported a week ago.  The other student was never able to import a copy of the file, even after copying/renaming it, but was able to create a totally new file and import it.


We are using Moodle 3.3.1+ (Build: 20170727)  (Yes, I need to update it, but we've had some database issues this year with the chance to UTF8MB4, which were my fault, and the other teachers get very worried when I have to take Moodle down right now.)  The students are using the newest version of the Moodle Mobile App 3.3.2 version 2020.  They are on iOS 10.3.3.  (The school won't let them update to the newest iOS yet.)

Average of ratings: -
In reply to Daniel Tillman

Re: Moodle Mobile Error {"code":1} when trying to add a file to shared file area

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Daniel,

I think that error is raised by the Cordova File plugin. Code 1 means "File not found".

Can you tell me the name of the files to verify if it's a problem with the file name?

Cheers,

Dani

In reply to Dani Palou

Re: Moodle Mobile Error {"code":1} when trying to add a file to shared file area

by Daniel Tillman -

Thank you for the reply and letting me know what the error code means.

I'm not aware of having installed a Cordova File plugin on Moodle.  (Looking in the list of installed plugins doesn't list a Cordova File plugin on my Moodle install.)


The students sent me the files via email.  Two are titled "The Sun.pdf",  another is "Whatisthatsound.pdf", another is "The road not taken.pdf".   The students also tried importing a file from GoodReader to the Moodle App and had the same error.   

I have tried to recreate the error on my iPad by importing the files they had issues with into Notability and then importing them into Moodle Mobile.  The files worked just fine on my iPad.  I have had them delete the Moodle Mobile app and reinstall it, changed the login method from via a browser window to within the app itself, changed the file storage size to make sure that they weren't hitting it, and had them reinstall Notability.  These two students (out of around 1,100) are having this issue on what seems to be every file they try to import to Moodle Mobile.  

I'm the Moodle Admin for the school, but I'm also a full time teacher this year so my time to test/troubleshoot is limited.  I also can't take their iPads for a day and use them to troubleshoot because they need their iPads for all of their other classes.


I've seen errors before when students tried to use emoji's in the file names, but there isn't even a space in the name of the Whatisthatsound.pdf file.


I have attached a copy of the Whatisthatsound.pdf file.


Thanks for all of your help.

Average of ratings: Useful (1)
In reply to Daniel Tillman

Re: Moodle Mobile Error {"code":1} when trying to add a file to shared file area

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi,

The Cordova File plugin is used by the app, it's not in Moodle. It's a plugin we need to be able to work with the files in the device.

I did some tests with that file and I was able to import them to the app successfully. Can they import those files with other apps (e.g. Adobe Acrobat Reader)? Also, can they share files from other apps (like Safari or Acrobat Reader) to the app?

It's the first time I see that error :/ The only thing I can think of is that maybe it's a problem with file permissions, but it's really weird that it only happens with these 2 students.

Kind regards,

Dani