c# - How do I play a downloaded mp3 file? -


i want play mp3 file downloaded database. can download mp3 file, seems have missing content can't play or open file. code download mp3 file looks follows:

/*the database stores file byte array*/ public actionresult download(int rid) {     byte[] filecontents = db.devotions.where(d=>d.id == rid).select(d=>d.bytesstore).singleordefault(); // gets file     return file(filecontents, "audio/mpeg3");//returns file } 

how can play downloaded mp3 file?

the reason returning 0 or default byte value because using .singleordefault();. return first value in sequence or default value, default value 0.

ensure data searching exists in bytesstore before fetching data.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -