How do I upload a file from iOS to my website? - javascript

I have a website that receives files from the user, using the "Choose file" interface for the OS they're on. This worked for me on Windows, Mac and Linux, but not on iOS. When I click the button that should load the interface, nothing happens. I guess I have to do it in a specific way for iOS. We're using the ZK framework to develop the website, but if you know how to do the upload in some other way, please tell me.

Up to iOS version 5.X, there is no possibility to upload a file via an html input tag. You would have to create a native App based on PhoneGap/Cordova to have the ability to create images/videos to be uploaded. But that's quite some effort to do. You should definitely think about the following option:
Since iOS version 6.0 Apple has added support for input type file elements. See more details on that here: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
This way seems to be appropriate, since the adoption rate of iOS 6 is quite high right now (nearly 80%): http://david-smith.org/iosversionstats/

Related

Is there any way to detect any installed application from browser using Javascript or Jquery?

I am stuck somewhere in my functionality where I want to check any specific application is installed or not?
For example : I have installed Microsoft Excel or MS-Teams in my windows laptop and from browser I want to check these application is installed or not? If it is installed then I want to show alert that particular application is installed.
Note : I do not have any code snippet for same to attach with Question. If you need any further information the please do let me know.
No, browser-based JavaScript code can't look to see if an arbitrary application is installed on the computer the browser is running on. It would be a massive security hole.
Certain applications or libraries install things that are then shown in the browser's userAgent string (for instance, Internet Explorer used to include information about which version(s) of the .Net framework are installed), but in the general case, you can't detect this (and Edge doesn't do that anymore).

How to open a HTTP server in react native

I want to be able to send music to sonos using its API. Unfortunately the only way I know is to send an URI to the device so it can download it.
I have visited already the package react-native-httpserver. This one has not been tested in Android. So I had a look over Android's nanoHTTPD and other similar packages in iOS as CocoaHTTPServer is.
It should not very difficult to create a wrapper over those packages to build something cross-platform but I wonder if there is another solution in Javascript or some work developing over react-native-tcp
I'll answer my own question, time has passed by and some packages have been released. Even with limitations, but looks promising so far:
HTTP Static server: https://github.com/futurepress/react-native-static-server
Quite flexible (but Android only) https://www.npmjs.com/package/react-native-http-server
Limited but both platforms https://github.com/alwx/react-native-http-bridge
Try to use react-native-fetch-blob https://github.com/wkh237/react-native-fetch-blob, I have used it to send pictures and It works very well. It supports both ios and Android

Slow keyboard/select picker to respond in cordova 4 iOS

Working on a couple apps, i've noticed recently the first time you interact with a text box or select tag, the keyboard/picker is slow to respond. After that, it's fine for the rest of the session. I saw something about changing the viewport, but that didn't fix it for me.
Loaded up an older application we built in the fall, and it seems to suffer the same problem. It did not when working on in fall/early winter.
Same problem with Cordova 4.2.1 and 4.3.0 with platform ios 3.7.0.
Platform ios 3.8.0 correct this problem.
But they don't correct one bug : Error: Cannot find module 'Q'
You need this patch. Don't forget to change 2 files :
platforms/ios/cordova/lib/list-devices
platforms/ios/cordova/lib/check_reqs.js

Windows Phone 8 app development-Download code

Is there any possibility to use download attribute to download an image that is already in assets in Windows phone 8 app development using html5?
According to Can I Use, the download attribute is not yet supported by any version of IE, so I strongly suspect it won't work.
That said, in my experience, Visual Studio's HTML validation is very limited, so it's often best to ignore the warning and try it out!

Playing back 3gp audio recorded in Android Cordova elsewhere

I would like to be able to record audio on a mobile device, in a Cordova app, then play it back on desktop computers in web applications. However, I'm running into some nasty codec issues.
According to the Cordova docs:
Android devices record audio in Adaptive Multi-Rate format. The
specified file should end with a .amr extension.
This seems wrong. According to the info here, .amr files should have headers that start with:
#!AMR.4
However, audio files from my Nexus 7 have headers like this:
....ftyp3gp4....
Which seems to indicate they should have .3gp extensions.
Furthermore, I don't think there is native browser support (outside of Cordova), for either format. I found a JavaScript amr playback library, however it cannot convert .3gp files (i.e. the files android produces). I'm betting a similar approach could be used to decode .3gp files, however it seems like a daunting task to take on. I'm hoping to avoid that. If someone else would like to do it I would be forever grateful.
If there is no way to change the format that the Cordova Media API produces, a decoder will be necessary. A pure JavaScript decoding solution would be ideal, a flash converter would be almost as good. The other possibilities I've considered have some issues:
One possibility is to use another app to do the conversion. For example, ffmpeg for android. I would like to avoid that because launching intents from Cordova requires a plug-in that Phonegap Build doesn't provide, and the user would have to deal with installing and operating another app.
Another possibility is to do decoding in the cloud. I don't want to run any of my own web services if possible. I've tried encoding.com and was able to successfully convert one of my audio files into a mp4, however they don't yet have Dropbox file watch support. And if the audio files need to be encrypted before reaching the could, for example because of HIPAA, then cloud decoding becomes really complicated, if not impossible.
Please help. Thank you.
The problem is that there are not many encoding codecs included in Android. If you look at this table you can see what is available pre Android 4.1. Phonegap uses AMR-NB as the encoding type in a 3gpp container.
My recommendation to you is to decode in the cloud.

Categories