internal static ApiResponse GetUploadFileResponse(UploadFilePacket data) { if (!data.FileUrl.EndsWith("/data", StringComparison.OrdinalIgnoreCase)) data.FileUrl += "/data"; data.RequestUri = new Uri(data.FileUrl); data.Method = "PUT"; return ApiRequestSender.SendPacket(data); }
internal void HandleFileUpload(Packet pa) { UploadFilePacket p = pa as UploadFilePacket; Mod m = Server.Mods.Find(new Predicate <Mod>(delegate(Mod mod) { if (mod.Identifier == p.Identifier) { return(true); } return(false); })); if (m == null) { m = new Mod(); } if (File.Exists(Config.ModsPath + "/" + m.ModFile)) { File.Delete(Config.ModsPath + "/" + m.ModFile); } currentDownload = m; downloaded = new byte[p.Size]; }