UPDATE. My colleague found this
https://github.com/stewartm83/angular-fileupload-sampleSo we'll see if we can adapt that sample.
Hi everybody,
I tried to help my colleague but we spent about 3h. on the phone together right now and didn't achieve anything :(
Here is the deal. We were using angular js file uploader. We have our own directive which is currently using angular-file-upload.js
* AngularJS file upload/drop directive and service with progress and abort
* @author Danial <danial.farid@gmail.com>
* @version 3.0.7
nuGet package shows that there is an update available
https://github.com/danialfarid/ng-file-uploadSo, we tried to incorporate new changes (the original interface changed).
But we can not figure out how to make the server side work and how exactly should we call upload method.
Here is the original server side method implemented by another colleague who is out right now:
[Route("UploadImage")]
public async Task<HttpResponseMessage> PostContactImages()
{
// Check if the request contains multipart/form-data.
if (Request.Content.IsMimeMultipartContent())
{
//var FormData = await Request.Content.ReadAsFormDataAsync();
try
{
//get the image options
var strImageOptions = HttpContext.Current.Request.Form["data"];
var imageOptions = Newtonsoft.Json.JsonConvert.DeserializeObject<ContactPhotoOptionsViewModel>(strImageOptions);
...
The problem here is that the Current.Request.Form doesn't have data property at all doesn't matter what we try.
So, I'm wondering if anyone used this service and can show their API implementation.
Thanks in advance.
If it's not broken, fix it until it is.
My Blog