File Upload using HTTP Post (multi form data)

Hi all,

I have a problem in uploding image data to a API service using http POST method my is as below

$scope.add = function(file){
console.log(“called add”);
var fd = new FormData();
fd.append(‘language’, ‘en’);
fd.append(‘apikey’, ‘XXXXXXX’);
fd.append(‘image’, file);
transformRequest: angular.identity,
headers: { ‘Content-Type’:undefined}
.success(function(response) {
$scope.ReadData = response;
.error(function(err) {


the above code works fine from Chrome and retrieves the data perfectly, but in the mobile device it is not picking the file it seems, or something is wrong so always it errors as file data missing but alerts do pop correctly.

thanks for your help in advance…!!

any comments … welcome…!!

For mobile upload you need cordova file-transfer plugin ;).
Greets, bengtler

Use ng-cordova

.uploadFile(server, filePath, options)
.then(function(result) {
  // Success! 
}, function(err) {
  // Error
}, function (progress) {
  // constant progress updates

Tq guys will try n let u know…

1 Like

btw: ng-cordova is the wrapper of ionic for file-transfer :wink:

1 Like

Hi ,
Did you tried file-transfer plugin?

Akşamdan beri uğraşıyorum servere resim yükleniyor ancak diğer post edilen verilere ulaşamıyorum aq

Merhaba! Lutfen Englishce yozunuz!