input type="file" give wrong results and invalid filemame

236 views
Skip to first unread message

Eric Liango

unread,
Jun 28, 2015, 4:17:38 PM6/28/15
to phon...@googlegroups.com
Hello

I have a website using input type="file" to open user pictures and send them to server

this works fine on computer and works fine with phone browser, on phone browser i get the good filement like 'picture.png' and upload will suceed

Why is this not possible with phonegap build ? It allow me to browse but will give a filename like 44%54664 or 54664 if i use file browser instead of gallery

And then the input type="file" get lost and could not send the picture...

I am using android 4.4.4 and phonegap build 3.7.0 thanks if anyone have a way to use the input type="file" with a plugin or some script to use in phonegap build

jcesarmobile

unread,
Jun 29, 2015, 2:28:19 AM6/29/15
to phon...@googlegroups.com
Input file is broken on android 4.4-4.4.2, and partially fixed on 4.4.3-4.4.4, working as you described.

You can read more about the issue and some plugins to use here:
http://stackoverflow.com/questions/19882331/html-file-input-in-android-webview-android-4-4-kitkat

Eric Liango

unread,
Jun 29, 2015, 4:02:18 AM6/29/15
to phon...@googlegroups.com
thanks i already checked this thread and i notices few things :

I dont have the issue with following :
- Skype app (so its possible to have this working fine in app)
- browser like firefox, google new release

but i have bug on :
- native samsung browser

more important i have seen this :

- the file loader is opening fine, what is wrong is the file name and so no type for picture (no base 64 header)

- in the file loader in phonegap (without script, only the input "file" event) i could enable the option "advanced option" this make appear 2 new system links (drives) and in them all is working fine, i could get all my files with real names (picture.png) and then upload them without issue
- if i script navigator.camera actions i get same issue, i could find files to send but with their link name (so image/xx%46545 or image/46545) but same i need to navigate in the 2 specials path

So what i need is a way to have the native file open action reading the files as expected and not their ID (number) names (if someone have a plugin wich will stop current behaviour and provide something like on skype it will be wonderfull)

jcesarmobile

unread,
Jun 29, 2015, 6:02:36 AM6/29/15
to phon...@googlegroups.com

Eric Liango

unread,
Jun 29, 2015, 4:04:45 PM6/29/15
to phon...@googlegroups.com
i will try again but even if they are able to show the real filemame (what i will try to test) i will get stuck as i will not been able to send the result to the "file input" as its not possible due to security reason. what i need is to have the default input file overriden or fixed

jcesarmobile

unread,
Jun 30, 2015, 2:11:53 AM6/30/15
to phon...@googlegroups.com
Then call google, maybe you can convince them to fix it, and once they fix it, call every handset manufacturer to update their devices with the fix.

None of that will happen, so your only option is to use one of the plugins and then use file transfer plugin to submit the file to the server

Eric Liango

unread,
Jun 30, 2015, 7:51:58 AM6/30/15
to phon...@googlegroups.com
I tried several time, but remember i am on "build" phonegap, one of them ask for R. and no way to compile with it (or i need to know how)

others give me the same issue, i dont have any value saying me what type of image i get, as the filename is missing (i get "464654") so its not reliable (i beleive i could "force" type somehow, but if i write .png and user take .gif i beleive it's dead)

I wonder if it's a permission issue, maybe somewhere it's needed to say "return me real name and not file ID" but i were beleaving this is : DATA_URL (i dont see real change with
FILE_URI)

Eric Liango

unread,
Jun 30, 2015, 8:06:16 AM6/30/15
to phon...@googlegroups.com

Kerri Shotts

unread,
Jun 30, 2015, 2:45:33 PM6/30/15
to phon...@googlegroups.com, starm...@gmail.com
PhoneGap Build lets you use a lot of plugins now. Check out their docs. You might also try the Crosswalk project (which now works on PG Build) -- it might be more consistent.

Have you tried using the File Transfer plugin to do the actual transfer instead? You might have better luck with that.

Eric Liango

unread,
Jul 4, 2015, 12:20:11 PM7/4/15
to phon...@googlegroups.com, starm...@gmail.com
Yes thanks anyway i have spent several hours on rebuilding code and so i have a "workaround" with custom script based on the current default cordova file transfert, it's just sad to have to create new code everytime something is not supported anymore
Reply all
Reply to author
Forward
0 new messages