i trying make app uploads images. use phonegap build android.
i can't seem ajax call use upload images, working. ajax call this:
$.ajax({ url: 'https://127.0.0.1:53827/api/v1/imageupload/uploadimage/' + + '/' + + '/veilingmeester', cache: false, type: "post", processdata: false, contenttype: false, data: formdata[i], async: false, headers: { 'access-control-allow-origin': '*.*', 'connect-src': 'https://localhost:53827' }, success: function (data) { //met deze data moeten nu een object aamaken voor de database output(image[i]); }, error: function (jqxhr, err) { logerror("error:" + err); logerror("jqxhr:" + jqxhr); logerror("jqxhr.status:" + jqxhr.status); logerror("jqxhr.statustext:" + jqxhr.statustext); } });
so searched around sf, can't work. config.xml looks this:
<?xml version='1.0' encoding='utf-8'?> <widget id="com.dangoo.img" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>dangoo pics</name> <description> upload plaatjes naar de dangoo server. vermakkelijk het proces van producten toevoegen! </description> <author email="rustenhovenmick@gmail.com" href="http://dangoo.info"> certigon development team </author> <content src="index.html" /> <plugin name="cordova-plugin-whitelist" version="1" /> <access origin="https://localhost:53827/*" /> <allow-navigation href="https://localhost:53827" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> <allow-intent href="tel:*" /> <allow-intent href="sms:*" /> <allow-intent href="mailto:*" /> <allow-intent href="geo:*" /> <platform name="android"> <allow-intent href="market:*" /> </platform> <platform name="ios"> <allow-intent href="itms:*" /> <allow-intent href="itms-apps:*" /> </platform> </widget>
i use plugin: github.com/apache/cordova-plugin-whitelist
i added these permissions:
<uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.read_phone_state" /> <uses-permission android:name="android.permission.access_wifi_state" />
i tried searching answer in many ways, can't seem find solution problem. if need specify anything, please tell me , i'll update asap.
this error get, when call.
added "async: false" ajax post. changed http connection https connection.
new error occurs:
you should replace localhost
server ip.
Comments
Post a Comment