FileUpload Element on iOS - AJAX Doesn't Allow Video Files

Is there any way to enable Video files to be captured or uploaded when using the AJAX file uploader? The standard, non-AJAX uploader allows this, but as soon as I turn on AJAX, I lose the ability to upload Video. I get both options on Android when using AJAX.

Screenshot attached to show the differences on the iOS front-end. In both of these scenarios, the "Device Capture" setting for the FileUpload element was set to "Off", but I did try every other option available in the "Device Capture" setting and was still not able to upload video using AJAX on iOS.

Also, I get the following error in the Joomla Admin/backend whenever I try to save the FileUpload Element when AJAX is turned on. I don't get the error when AJAX is turned off. Not sure if this is related or if it's a different issue with the element.

An error has occurred.

1103 Incorrect table name 'customer_vehicle_build_submissions_repeat_upload_now_2' SQL=CREATE TABLE IF NOT EXISTS `customer_vehicle_build_submissions_repeat_upload_now_2` ( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, parent_id INT(11), `upload_now_2` TEXT, `params` TEXT );
 

Attachments

  • fabrik-ios-upload-issues.jpg
    fabrik-ios-upload-issues.jpg
    889.5 KB · Views: 200
No idea about the iOS thing, and I can't test it as I don't own an iThing.

I think the issue with that table name is it's too long. I think MySQL has a 64 character limit, and we build the name of the table we automatically create to hold the "many" files by combining table and element names.

You'll have to rename your element to something shorter, so the automatically generated name is shorter.

-- hugh
 
Crap. The name of the table that my form uses is 49 characters long. Any way to change that after the form has been built, or do I have to recreate everything?
 
Hmmm. It's very difficult to change a table name, as it's used in a lot of places in the metadata (the #__fabrik_foo tables). If you don't have any joins to it, you can try modifying your fabrik_lists table (should be obvious what you need to change). If you have joins to it, you'll need to edit the fabrik_joins table as well.

Needless to say BACK UP YOUR DATABASE first.

However, my advice would be blow it away and recreate it, and keep your table names shorter.

We should really set a max length of table names we will accept, by enough to allow us the wiggle room to add those postfixes to our automatically generated tables, but I didn't know about that 64 char limit until recently, and it's not easy to retrofit that limitation.

-- hugh
 
Yeah, makes perfect sense, and I'm sure there are tons of dependencies on the table name of the original list/form. I rebuilt it per your recommendation, wasn't too much work.

AND, I was able to figure out the iOS issue. I haven't thoroughly tested it yet, but by adding "jpg, jpeg, gif, png, mp4, avi, m4v, mov" to the "Allowed File Types", I now get both photo and video options in iOS. I'll do some testing in the next day or two, but it appears to work. Hope this helps someone else out. STOKED! :)
 
Last edited:
YAY! I love it when stuff works.

Thanks for sleuthing that for us. I just wish iOS had more than 3 letters so it would be searchable in the forums.

-- hugh
 
Yeah, makes perfect sense, and I'm sure there are tons of dependencies on the table name of the original list/form. I rebuilt it per your recommendation, wasn't too much work.

On the whole, we do try not to use symbolic names in our metadata, and use id's instead. But for some stuff, that's just too much of an overhead. And for other stuff, like table names, which go back to the beginning of recorded Fabrik (mosforms) history, the code is so fossilized that it would be pretty much impossible to change it at this point.

I did once consider writing a little command line script to do this, basically just doing a global replace on every relevant column in every metadata table, as it's something that crops up fairly frequently. But the trouble with that is, I'm then responsible for any carnage it wreaks on people's data.

However ... setting a restriction on table name length is something I can and should do, to prevent this from happening to someone else. It's just very unusual for people to use 40+ character table names, so the problem has only ever cropped up once or twice.

-- hugh
 
I've done some further testing on iOS, videos can now be uploaded. But when using AJAX, the fileupload plugin only accepts one file-type at a time when multi-selecting media in iOS.

For example, if I click "+Add Files" and select 3 JPEG images (the default photo format in iOS) and tap done, only one image will appear in the Upload List. But if I select one JPEG, one PNG, and one MOV, all three will show up in the Upload List. Not sure how to fix this, but it might be due to Apple outputting every image file name as "image.jpeg".

Multi-select works fine on desktops, but on Android, I was only able to select one file at a time. I had to click "+Add Files" again to attach multiple images and videos.

Lastly... and this is a big one... I think I've found a critical issue with the AJAX file handling. Here are the steps to reproduce it.

1. Set up a form with the AJAX file upload element enabled.
2. Upload any file, confirm it works and the file was uploaded to the server. Lets assume the file name is "image.jpeg"
3. Reload the page/form.
4. Select the same file, "image.jpeg", but do not click "Start Upload". At this point, the same image/file name should be queued for upload.
5. Click the "X" to remove it from the AJAX upload list. You'll get a message stating "Do you want to delete the file from the server?".
6. Click "OK"
7. Now check the server, the file you uploaded in step #2 has now been deleted from the server.

This happens, even if the elements option is set to "Keep Original and Increment File Name" when duplicates are found. Any way to fix this one?
 
I've observed so many different behaviors on even different versions of Android, let alone across iOS and Android, it's difficult to know how to even start evening the behavior out.

I'm sure the delete thing is fixable, really just a case of finding the time to fix it. The upload element is distinctly non-trivial. I'll see if there's a "cheap" fix, involving hiding/showing the delete button.

-- hugh
 
Yeah, I'm sure it's not easy sorting out all the different experiences.

Regarding the other issue, I think I just found a workaround. If you turn on Obfuscate Filename, no files will be deleted from the server, before or after they are uploaded. That works for me, since I don't really care what the file names are, but still a good bug to backlog.
 
I've done some further testing on iOS, videos can now be uploaded. But when using AJAX, the fileupload plugin only accepts one file-type at a time when multi-selecting media in iOS.

For example, if I click "+Add Files" and select 3 JPEG images (the default photo format in iOS) and tap done, only one image will appear in the Upload List. But if I select one JPEG, one PNG, and one MOV, all three will show up in the Upload List. Not sure how to fix this, but it might be due to Apple outputting every image file name as "image.jpeg".

Hi, did you find any solution for this problem?
I have the same issue when uploading multiple images for iOS.
 
Hi, did you find any solution for this problem?
I have the same issue when uploading multiple images for iOS.

No, I wasn't able to find a work-around for this issue. I've seen other websites allow multiple image selection on iOS, so I'm sure it's possible, but I think it's something that would have to be fixed in the elements code, which is beyond my abilities.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top