Markdown video and audio, supported at client side
* BlogsController.cs: Fixes the Markdown usage of the uploaded files: Files are now renamed by dropping invalid characters and replacing spaces by underscores. An existing destination file is removed at upload. * showdown.js: Renders audio and video at client side * to-markdown.js: converts html audio and video to Markdown * TestByteA.cs: adds a prefix, an underscore, to the test table `_testbytea` * Edit.aspx: Uses the new `showdown` javascript module (that previously was named `Showdown`) * Web.csproj: cleaning * MarkdownDeep.dll: Renders video an audio * GruntFile.js: Was pollution
This commit is contained in:
parent
77149697dd
commit
9912d0cbb2
9 changed files with 2357 additions and 432 deletions
|
|
@ -94,6 +94,7 @@ namespace Yavsc.ApiControllers
|
|||
string root = HttpContext.Current.Server.MapPath("~/bfiles/"+id);
|
||||
DirectoryInfo di = new DirectoryInfo (root);
|
||||
if (!di.Exists) di.Create ();
|
||||
|
||||
var provider = new MultipartFormDataStreamProvider(root);
|
||||
try
|
||||
{
|
||||
|
|
@ -105,12 +106,15 @@ namespace Yavsc.ApiControllers
|
|||
string filename = provider.BodyPartFileNames[fkey];
|
||||
Trace.WriteLine(filename);
|
||||
|
||||
string nicename=fkey;
|
||||
string nicename = HttpUtility.UrlDecode(fkey) ;
|
||||
if (fkey.StartsWith("\"") && fkey.EndsWith("\"") && fkey.Length > 2)
|
||||
nicename = fkey.Substring(1,fkey.Length-2);
|
||||
var filtered = new string (nicename.Where( x=> !invalidChars.Contains(x)).ToArray());
|
||||
File.Move(Path.Combine(root,filename),
|
||||
Path.Combine(root,filtered));
|
||||
nicename = new string (nicename.Where( x=> !invalidChars.Contains(x)).ToArray());
|
||||
nicename = nicename.Replace(' ','_');
|
||||
var dest = Path.Combine(root,nicename);
|
||||
var fi = new FileInfo(dest);
|
||||
if (fi.Exists) fi.Delete();
|
||||
File.Move(filename, fi.FullName);
|
||||
}
|
||||
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue