Skip to content

Commit

Permalink
- BugFix #15046: XmlRpc integration for the media module...
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042134
  • Loading branch information
suhacan committed Nov 25, 2009
1 parent 5fc4f9b commit b1e987e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public class XmlRpcHandler : IXmlRpcHandler {
var name = file.Optional<string>("name");
var bits = file.Optional<byte[]>("bits");

var target = HttpContext.Current.Server.MapPath("~/Files/" + name);
var target = HttpContext.Current.Server.MapPath("~/Media/" + name);
Directory.CreateDirectory(Path.GetDirectoryName(target));
using (var stream = new FileStream(target, FileMode.Create, FileAccess.Write, FileShare.ReadWrite)) {
stream.Write(bits, 0, bits.Length);
}

uriBuilder.Path = uriBuilder.Path.TrimEnd('/') + "/Files/" + name.TrimStart('/');
uriBuilder.Path = uriBuilder.Path.TrimEnd('/') + "/Media/" + name.TrimStart('/');
return new XRpcStruct().Set("url", uriBuilder.Uri.AbsoluteUri);
}

Expand Down

0 comments on commit b1e987e

Please sign in to comment.