asp.net mvc - MVC4 returning an Amazon S3 mp3 file -


i have web app lots of mp3's download. have download links next each mp3 download. want record talks downloaded, download link goes controller action.

public actionresult downloadtalk(int talkid) 

the action calls repository increment talk has been downloaded. talks stored on amazon s3 , acl has them publicly available via url.

i'd able force download of file. @ moment i'm redirecting url, causes file downloaded, causes mp3 file opened in browser (which don't want).

 return redirect(talk.url); 

i know how memorystream of media s3 using sdk how force download (return fileactionresult) based upon either memorystream or url?

any appreciated.

public actionresult downloadtalk(int talkid) {     var talk = gettalk(talkid);     incrementtalkcount(talk);     var stream = getstreamfromtalk(talk);     return file(stream, "contenttype", "filename"); } 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -