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 ?
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
Post a Comment