fixes the path to user's files
This commit is contained in:
parent
2ddb46153a
commit
f5b29c4f91
1 changed files with 6 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Authorization;
|
using Microsoft.AspNet.Authorization;
|
||||||
using Microsoft.AspNet.Hosting;
|
using Microsoft.AspNet.Hosting;
|
||||||
|
|
@ -42,8 +43,11 @@ namespace Yavsc.Controllers
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return new BadRequestObjectResult(ModelState);
|
return new BadRequestObjectResult(ModelState);
|
||||||
var results = new List<string>();
|
var results = new List<string>();
|
||||||
var uploads = Path.Combine(_environment.WebRootPath, _siteSettings.UserFiles.DirName);
|
var uploads = Path.Combine(
|
||||||
uploads = Path.Combine(uploads, model.PostId.ToString());
|
Path.Combine(_environment.WebRootPath, _siteSettings.UserFiles.DirName),
|
||||||
|
User.GetUserId()
|
||||||
|
);
|
||||||
|
// uploads = Path.Combine(uploads, model.PostId.ToString());
|
||||||
var spot = new FileSpotInfo(uploads, blogEntry);
|
var spot = new FileSpotInfo(uploads, blogEntry);
|
||||||
if (!await _authorizationService.AuthorizeAsync(User, spot, new EditRequirement()))
|
if (!await _authorizationService.AuthorizeAsync(User, spot, new EditRequirement()))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue