Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

photo/video/image file input naming not unique on iOS #374

Closed
MartijnR opened this issue Dec 29, 2015 · 9 comments
Closed

photo/video/image file input naming not unique on iOS #374

MartijnR opened this issue Dec 29, 2015 · 9 comments
Milestone

Comments

@MartijnR
Copy link
Member

This means that multiple photos (multiple photo inputs) in same record get overwritten by the last photo.

Reproducable with Safari on iOS which names all photos image.jpg and videos capturedvideo.MOV

Need to simply give a random file name it seems. Unfortunately, it will probably not be possible to make a distinction between an OS-named file and a user-name file. So all filenames will be overwritten by random string.

Urgent.

@MartijnR MartijnR added the bug label Dec 29, 2015
@MartijnR MartijnR added this to the KoBoWoRk milestone Dec 29, 2015
@MartijnR MartijnR added the KoBo label Dec 29, 2015
@MartijnR
Copy link
Member Author

Puffin names files tmp.dat (which can be renamed with a proper extension, if you know it, to see the file). I doubt it will be possible to guess the file format in Puffin, in which case there is no way to correct the file extension (jpg/png/mov/mp3/etc). In that case, we should try to warn users away from Puffin (as in Chrome...).

@MartijnR
Copy link
Member Author

Check what a proper browser such as Chrome on Android does with real-time camera input fields.

@MartijnR
Copy link
Member Author

just append random number to filename to avoid irritation with filename changing?

@MartijnR
Copy link
Member Author

Android Chrome doesn't have this issue. It uses a random filename.

@MartijnR MartijnR changed the title photo/video/image file input naming not unique photo/video/image file input naming not unique on iOS Dec 30, 2015
@MartijnR
Copy link
Member Author

issue: can't change the name property in the file input itself. This makes a fix rather complex.

@MartijnR
Copy link
Member Author

also take into account on iOS Safari, that the user may replace an existing file (image.png) with a new file (image.png)....

@MartijnR
Copy link
Member Author

  • ensure files are stored (offline-capable views) and uploaded (online-only views) with amended file names
  • test loading from storage
  • test clearing loaded from storage file
  • test clearing newly input file
  • test online-only webform
  • test offline-capable webform
  • namePostfix property is sometimes not present on files in Chrome and Safari Desktop - (when obtaining from file manager)
  • add util function tests
  • update file-manager in EE!
  • test iOS safari
  • test Chrome Android

Seems like it is not reliable to add new property to file in file input. It randomly disappears.

MartijnR added a commit to enketo/enketo-core that referenced this issue Dec 31, 2015
@MartijnR
Copy link
Member Author

iPad Chrome does not want to submit http://enk.to/::YYYZ but might be network problem

Update: seemed related to internet connection

@MartijnR
Copy link
Member Author

MartijnR commented Jan 1, 2016

Puffin works too, except for getting the .dat extension (browser bug)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant