how to upload File in angularjs frontend -


i want upload data api following signature want double check how data received.i have used ordinary modules in angular upload file want check how file pushed api. want file collection of bytes reaches api here uploading file. internal transfer protocol change bytes ?enter image description here

notice file has type of collection of bytes. how should upload

for use ng-file-upload. using upload service call api this:

upload.upload({   url: '/api/uploadfile',   fields: {filename: 'filename', fileext: '.doc'},   file: file }) 

the file uploaded type arraybuffer , can need on end.

here snippet download using filesaver,js:

$http.post('/api/downloadfile', 'filename', {responsetype: "arraybuffer"}).   success(function(data) {     var blob = new blob([data], { type: '.doc' });     saveas(blob, file.filename);   }) 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -