I need to save a PDF file which the user uploads to database as a byte array (in Angular JS). I have tried using the file upload module provided by Angular. It doesnt seem to work for me.I have also tried posting the PDF file through a $http post call of jquery. This method works if I accept the data at the server side as a dynamic object of Newtonsoft. However I need a byte array and I am unable to convert this object to a byte array.
This questions is not really about angular but instead it is, based on your description, about how to upload a file using I would recommend your start trying to upload your file using this exmaple: http://blogs.msdn.com/b/henrikn/archive/2012/03/01/file-upload-and-asp-net-web-api.aspx When it is ready then adapting it to your angular app. |
|||||
|
I had a similar issue a while back. Have a look at this Stack Overflow link. Uploading/Downloading Byte Arrays with AngularJS and ASP.NET Web API If you still have some questions, let me know. I am sending and receiving a lot of byte array data between my clients and servers using Web API. The approach I use is compatible with iPhones, iPad, Android devices, Macs, and Windows PCs/laptops. I haven't checked it on Windows phones yet, but do not expect any problems. Regards.... |
|||
|