Upload a file when authenticated with a cookie

Hey There!

I am looking for your help to solve my problem which is uploading a file (picture) being authenticated with a cookie.

What I can do :
I communicate with a server. I can authenticate using @angular/http requests easily. It’s a cookie based authentication, so it seems like my ionic app is storing (where ?) the cookie, because then when I communicate with the server, I am seen as an authenticated user.

What I want to do :
I want to upload a file, hence I am using the file-transfer plugin and using the upload function. This works fine.

What I can NOT do :
I need to upload a file (a picture) but I need to be authenticated to do it. But the file-transfer upload function doesn’t make the request using the cookie I should have based on my previous assumption. Hence I get an error from the server saying I have to authenticate. Why am I not authenticated this time ?

What I tried already :
I wanted to get the cookie from the http request I use to authenticate. Hence, I tried to read the headers of it but it seems like “Set-Cookie” header is not here. Strange thing is, that the header is here when I’m using another service to make the requests (on Postman) (the requests are the same). Is Ionic (or Cordova) preventing me from accessing it ?

What I could do but I don’t know how to yet :
I could upload the file doing a POST request with @angular/http using a FormData object. But how can I “put” the file (I have the absolute path of it only) in this FormData object ? Is it the best (and only ?) way to solve my problem ?

Thank you for reading this.
I am really looking forward your help.
gregunz.io

note : I am running Ionic v.2