{ "id": "154482", "key": "AC-1310", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2016-02-01T06:59:33.000+0000", "created": "2016-01-22T20:31:39.000+0000", "labels": [ "HttpClient" ], "versions": [ { "id": "17038", "name": "Appcelerator Studio 4.5.0", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updated": "2016-03-08T07:37:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Below is a simplistic test case. In practice I've done this with large blob data of >10M which showed progress = 1 for a minute over and over again.\r\n\r\n{code:javascript}\r\nvar httpClient = Ti.Network.createHTTPClient({\r\n onload: function() {\r\n Ti.API.debug(\"Upload file responseText: \" + this.responseText);\r\n },\r\n onerror: function(e) {\r\n Ti.API.error(\"Error uploading file: \" + e.error);\r\n Ti.API.debug(\"Upload file responseText: \" + this.responseText);\r\n },\r\n onsendstream: function(e) {\r\n var progress = parseFloat(e.progress);\r\n Ti.API.trace(\"Upload progress: \" + 100 * progress);\r\n }\r\n});\r\n\r\nhttpClient.open('POST', 'https://example.org');\r\n\r\n// e.progress returns as expected 0.0 - 1.0\r\nvar args = {'field1': 'value1'};\r\nhttpClient.send(args);\r\n\r\n\r\n// e.progress will only return 1\r\nvar args = Ti.createBuffer({value: 'fields: value1'}).toBlob();\r\nhttpClient.send(args);\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "onsendstream for HttpClient does not update progress properly when sending Blob", "creator": { "name": "isleshocky77", "key": "isleshocky77", "displayName": "Stephen Ostrow", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "isleshocky77", "key": "isleshocky77", "displayName": "Stephen Ostrow", "active": true, "timeZone": "America/New_York" }, "environment": "user@user-msi /srv/virtuvia_mobile/project/cmp_mobile_alloy $ appc ti info\r\nAppcelerator Command-Line Interface, version 5.1.0\r\nCopyright (c) 2014-2016, Appcelerator, Inc. All Rights Reserved.\r\n\r\nOperating System\r\n Name = Linux Mint 17.2 Rafaela\r\n Version = 17.2\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 15.6GB\r\n\r\nNode.js\r\n Node.js Version = 4.2.4\r\n npm Version = 2.14.12\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.5\r\n node-appc Version = 0.2.31\r\n\r\nTitanium SDKs\r\n 5.1.2.GA\r\n Version = 5.1.2\r\n Install Location = /home/user/.titanium/mobilesdk/linux/5.1.2.GA\r\n Platforms = android, mobileweb\r\n git Hash = ca822b2\r\n git Timestamp = 12/16/15 19:00\r\n node-appc Version = 0.2.32\r\n 3.5.1.GA\r\n Version = 3.5.1\r\n Install Location = /home/user/.titanium/mobilesdk/linux/3.5.1.GA\r\n Platforms = mobileweb, android, blackberry\r\n git Hash = 96875c9\r\n git Timestamp = 03/05/15 10:08\r\n node-appc Version = 0.2.24\r\n \r\nIntelĀ® Hardware Accelerated Execution Manager (HAXM)\r\n Not installed\r\n\r\nJava Development Kit\r\n Version = 1.8.0_66\r\n Java Home = /usr/lib/jvm/java-8-oracle\r\n\r\nGenymotion\r\n Path = not found\r\n Genymotion Executable = not found\r\n Genymotion Player = not found\r\n Home = not found\r\n\r\nVirtualBox\r\n Executable = not found\r\n Version = unknown\r\n\r\nAndroid SDK\r\n Android Executable = /home/user/Android/Sdk/tools/android\r\n ADB Executable = /home/user/Android/Sdk/platform-tools/adb\r\n SDK Path = /home/user/Android/Sdk\r\n\r\nAndroid NDK\r\n NDK Path = not found\r\n NDK Version = not found\r\n\r\nAndroid Platforms\r\n 1) android-15\r\n Name = Android 4.0.3 **Not supported by Titanium SDK 5.1.2.GA**\r\n API Level = 15\r\n Revision = 5\r\n Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800\r\n ABIs = no ABIs.\r\n Path = /home/user/Android/Sdk/platforms/android-15\r\n 2) android-22\r\n Name = Android 5.1.1 **Not supported by Titanium SDK 5.1.2.GA**\r\n API Level = 22\r\n Revision = 2\r\n Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in\r\n ABIs = x86, x86_64\r\n Path = /home/user/Android/Sdk/platforms/android-22\r\n 3) android-23\r\n Name = Android 6.0\r\n API Level = 23\r\n Revision = 2\r\n Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in\r\n ABIs = no ABIs.\r\n Path = /home/user/Android/Sdk/platforms/android-23\r\n\r\nAndroid Add-Ons\r\n None\r\n\r\nAndroid Emulators\r\n Nexus_9_API_22\r\n Path = /home/user/.android/avd/Nexus_9_API_22.avd\r\n SDK Version = Android 5.1.1 (API level 22)\r\n ABI = x86_64\r\n Skin = 800x1280\r\n SD Card = /home/user/.android/avd/Nexus_9_API_22.avd/sdcard.img\r\n Google APIs = no\r\n\r\nGenymotion Emulators\r\n None\r\n\r\nConnected Android Devices\r\n None\r\n\r\nAndroid Issues\r\n ! Unable to locate an /usr/lib/libGL.so.\r\n Without the libGL library, the Android Emulator may not work properly.\r\n You may be able to fix it by reinstalling your graphics drivers and make sure it installs the\r\n 32-bit version.\r\n\r\n ! Unable to locate an Android NDK.\r\n Without the NDK, you will not be able to build native Android Titanium modules.\r\n If you have already downloaded and installed the Android NDK, you can tell Titanium where the\r\n Android NDK is located by running 'titanium config android.ndkPath /path/to/android-ndk',\r\n otherwise you can install it by running 'titanium setup android' or manually downloading from\r\n http://appcelerator.com/android-ndk.\r\n\r\n ! Android API Android 4.0.3 (android-15) is too old and is no longer supported by Titanium SDK\r\n 5.1.2.\r\n The minimum supported Android API level by Titanium SDK 5.1.2 is API level 23.\r\n\r\n ! Android API Android 5.1.1 (android-22) is too old and is no longer supported by Titanium SDK\r\n 5.1.2.\r\n The minimum supported Android API level by Titanium SDK 5.1.2 is API level 23.\r\n", "comment": { "comments": [ { "id": "375217", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you provide a full code and data file that you are uploading. We will try to reproduce it in our environment. Assuming you have a server-side service which accepts file uploads, you should find upload fairly straightforward. Titanium already upload a file as a blob if it's a image file. I was trying the below uploading image file code and it's working as expected. \r\n\r\n{code}\r\nvar form_url = 'http://apps.priyo.com/jonopriyo/image.php';\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tlayout : 'vertical',\r\n\t\tbackgroundColor : '#fff'\r\n\t});\r\n\r\n\tvar btnPhoto = Ti.UI.createButton({\r\n\t\ttitle : 'Select Photo'\r\n\t});\r\n\tbtnPhoto.addEventListener('click', function(e) {\r\n\t\t// Open photo gallery for user to select photo\r\n\t\tTi.Media.openPhotoGallery({\r\n\t\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\r\n\t\t\tsuccess : function(e) {\r\n\t\t\t\tbtnPhoto.value = e.media;\r\n\t\t\t\tanImageView.image = e.media;\r\n\t\t\t\tbtnPhoto.title = '[ Photo Selected ]';\r\n\t\t\t},\r\n\t\t\tcancel : function() {\r\n\t\t\t\tbtnPhoto.value = null;\r\n\t\t\t\tbtnPhoto.title = 'Select Photo...';\r\n\t\t\t},\r\n\t\t\terror : function(err) {\r\n\t\t\t\tTi.API.error(err);\r\n\t\t\t\tbtnPhoto.value = null;\r\n\t\t\t\tbtnPhoto.title = 'Select Photo...';\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\twin.add(btnPhoto);\r\n\r\n\tvar btnSubmit = Ti.UI.createButton({\r\n\t\ttitle : 'Submit'\r\n\t});\r\n\tbtnSubmit.addEventListener('click', function(e) {\r\n\r\n\t\tvar c = Titanium.Network.createHTTPClient({\r\n\t\t\tonload : function(e) {\r\n\r\n\t\t\t\tTi.API.info('this.responseText' + this.responseText);\r\n\t\t\t\tjson = JSON.stringify(this.responseText);\r\n\t\t\t\talert(this.responseText);\r\n\t\t\t},\r\n\t\t\tonerror : function(e) {\r\n\t\t\t\talert(JSON.stringify(e));\r\n\t\t\t},\r\n onsendstream : function(e) {\r\n var progress = parseFloat(e.progress);\r\n Ti.API.info(\"Upload progress: \" + 100 * progress);\r\n }\r\n\t\t});\r\n\t\tc.open('POST', form_url);\r\n\t\tTi.API.info('form_url ' + encodeURI(form_url));\r\n\t\t// c.setRequestHeader('Content-Type', 'multipart/form-data');\r\n\t\tc.send({\r\n\t\t\tuserid : 81,\r\n\t\t\timage : btnPhoto.value\r\n\t\t});\r\n\t});\r\n\twin.add(btnSubmit);\r\n\tvar anImageView = Ti.UI.createImageView({\r\n\r\n\t});\r\n\tanImageView.addEventListener('load', function() {\r\n\t\tTi.API.info('Image loaded!');\r\n\t});\r\n\r\n\t// Add to the parent view.\r\n\twin.add(anImageView);\r\n\twin.open();\r\n{code}\r\n\r\nPlease provide a complite project that demonstrate the issue. ANd steps to reproduce. Thanks.\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-01-24T10:23:46.000+0000", "updated": "2016-01-24T10:23:46.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }