Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 77

jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
12/09/15 03:39 AM (6 years ago)

Upload image in Custom URL for Android

Hi, in my Android app I have a Custom URL screen which loads an HTML with <input type="file"> button. The button does not work. Is there any alternatives to upload an image from within the Custom URL screen? Here is a test page that I made: http://inventionapps.com/usedvape.com/home/test Thanks in advance :)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
12/09/15 05:46 AM (6 years ago)
It won't work with 'type=file'. use 'type=image'. <input type="image" src="http://www.yourserver.com/path/to/image.png" /> alternatively, you can add this to buttons either via css or in tag: style="background: url(http://www.yourserver.com/path/to/image.png)" Cheers! -- Smug
 
jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
like
12/09/15 05:31 PM (6 years ago)
Hello Smug, what I meant is that I'm using a Custom URL screen to load an HTML page that has an <input type="file"> on it, in order for users to upload an image. The button doesn't work. Are there any alternatives to upload an image from within the Custom URL screen?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
12/09/15 07:35 PM (6 years ago)
Does it show in a desktop browser? If so, then it 'should' display just fine in the CustomURL. If it doesn't, then the problem will be with the source document. If you can't modify the source, there isn't much that can be done. If it 'does' show up ok in a desktop browser, then maybe there is an issue with the display of the CustomURL plugin. Seems odd, but maybe... I've never had that situation. But if I did, I'd try the same thing in the 'HTMLDoc' plugin, and (in the control panel properties) just set it to 'refresh' all the time, thus emulating the same properties as the CustomURL. Try it and see if it helps any. Cheers! -- Smug
 
jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
like
12/09/15 11:34 PM (6 years ago)
Hi Smug, it works fine in a desktop browser. It doesn't work both in the CustomURL and when using the Android browser. Where can I find the 'HTMLDoc' plugin? I have a self-hosted BT server.
 
jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
like
12/09/15 11:40 PM (6 years ago)
Here is a test page that I made: http://inventionapps.com/usedvape.com/home/test The "Choose File" button works on the desktop browser. It doesn't work in an Android phone browser.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
12/10/15 02:08 AM (6 years ago)
From something I tried a while back I seem to remember that uploading image files using a mobile browser behaves differently to a desktop. You might need to do it in code.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
12/10/15 02:11 AM (6 years ago)
I just tried an upload using your test web page - did it work? I can't tell but it may have.
 
jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
like
12/10/15 07:09 PM (6 years ago)
Hi AlanMac, did you open the link from your desktop or in your android mobile browser? It will work on desktop. Did it work on android mobile browser?
 
jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
like
12/11/15 01:30 AM (6 years ago)
Here's a link that is similar to my problem. I don't know how to make it work in BuzzTouch: https://stackoverflow.com/questions/5907369/file-upload-in-webview
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
12/11/15 02:01 AM (6 years ago)
I used chrome on an IPhone 5
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
12/11/15 02:03 AM (6 years ago)
Btw, did you find a pic of a couple of plastic food containers from me?
 
jake
I hate code!
Profile
Posts: 20
Reg: Apr 10, 2012
location unknow...
200
like
12/11/15 05:21 AM (6 years ago)
Hi AlanMac, the page will definitely work in iOS. It's on the Android phone that I'm having a problem with it. On android, the &quot;Choose File&quot; button does not open a dialog or launch a camera. The test page I made is not going to upload anything. I just made it to point out that when you click on the &quot;Choose File&quot; button, it opens a dialog on a desktop browser and in iOS. But it doesn't do anything on Android.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
12/11/15 08:10 AM (6 years ago)
The article you referenced suggests early versions of Android may not be compatible with this approach. I tried your test page on my Sony Xperia using Android 5 and Firefox. I saw a Browse and Upload buttons and I was able to select a file and click Upload. I ended up with Access Denied. So it sounds like it can work in a browser on Android, but not sure if my findings are helpful.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
Fourm StarFourm Star
like
12/12/15 05:07 PM (6 years ago)
Who would like a plugin like this that uploads pictures and videos to the server, without having to use a a webView? It would work wayyy better
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.