public IHttpActionResult SaveItem(string storeId, Page page)
		{
			if (!string.IsNullOrEmpty(page.FileUrl))
			{
				using(var webClient = new WebClient())
				{
					var byteContent = webClient.DownloadData(page.FileUrl);
					page.ByteContent = byteContent;
				}
			}

			_pagesService.SavePage(storeId, page.ToCoreModel());
			return Ok();
		}
Esempio n. 2
0
        public IHttpActionResult SaveItem(string storeId, Page page)
        {
            base.CheckCurrentUserHasPermissionForObjects(ContentPredefinedPermissions.Update, new ContentScopeObject { StoreId = storeId });

            if (!string.IsNullOrEmpty(page.FileUrl))
            {
                using (var webClient = new WebClient())
                {
                    var byteContent = webClient.DownloadData(page.FileUrl);
                    page.ByteContent = byteContent;
                }
            }

            _pagesService.SavePage(storeId, page.ToCoreModel());
            return StatusCode(HttpStatusCode.NoContent);
        }