Vote count:
0
I'm using FileResult to show files in my web site as the following:
public ActionResult GetSwf(long id = 0)
{
if (id <= 0) return null;
Attachment attachment = Service.GetAttachmentById(id, new List<string>());
if (attachment == null) return null;
string filename = attachment.Name;
string mimeType = "application/x-shockwave-flash";
string absoluteFilePath = UploadedPaths.GetAbsolutePath(attachment.Path);
return File(absoluteFilePath, mimeType, filename);
}
It doesn't work for the following tag and the browser is going to download file instead of show it!
<object type="application/x-shockwave-flash" width="220" height="166" data="File/GetSwf/1232" class="flash-object" data-name="ads-file"></object>
What's wrong, how can I fix it?
asked 25 secs ago
FileResult doesn't work for swf files?
Aucun commentaire:
Enregistrer un commentaire