Please respond to the error JSON
No Brother
i changed the name to UploadProfilePicture1 but the same error UploadProfilePicture1 is a copy of UploadProfilePicture.
So if it would call UploadProfilePicture it should have still worked,
the error is what i attached image earlier.
'This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.'
Regards
Anwar
Hi
Exactly the same process as profilepicturechange, but here is the code
vm.uploader = new fileUploader({ url: abp.appPath + 'Profile/UploadProfilePicture', headers: { "X-XSRF-TOKEN": abp.security.antiForgery.getToken() }, queueLimit: 1, autoUpload: true, removeAfterUpload: true, filters: [{ name: 'imageFilter', fn: function (item, options) { //File type check var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; if ('|jpg|jpeg|png|gif|'.indexOf(type) === -1) { abp.message.warn(app.localize('ProfilePicture_Warn_FileType')); return false; }
//File size check
if (item.size > 1048576) //1MB
{
abp.message.warn(app.localize('ProfilePicture_Warn_SizeLimit'));
return false;
}
return true;
}
}]
});
vm.uploader.onSuccessItem = function (fileItem, response, status, headers) {
if (response.success) {
var $profilePictureResize = $('#ProfilePictureResize');
vm.courselevels.image = vm.uploadedFileName;
var newCanvasHeight = response.result.height * $profilePictureResize.width() / response.result.width;
$profilePictureResize.height(newCanvasHeight + 'px');
var profileFilePath = abp.appPath + 'Temp/Downloads/' + response.result.fileName + '?v=' + new Date().valueOf();
vm.uploadedFileName = fileItem.file.name;
// if ($jcropImage) {
// $jcropImage.data('Jcrop').destroy();
// }
$profilePictureResize.attr('src', profileFilePath);
}
};
Sent you the login credentials for the site,
To Mimic the error, you need to do the needful.
after logging in on the left menus select category, click create new,
enter 'HomeDecor' for all fields check active and select recording option load any image from your local system press 'SAVE'
once logged in you can also try to change profile picture and see the other error.
Regards Anwar
using System.Threading.Tasks; using Abp.Application.Services; using Abp.Application.Services.Dto; using Samit.CmsProTest.School.Courses.Dto; using Abp.Domain.Repositories; using Abp.AutoMapper; using Abp.Linq.Extensions; using Abp.Extensions; using Samit.CmsProTest.Authorization; using Abp.Authorization; using System.Data.Entity; using System; using System.Collections.Generic; using System.Linq; using Abp.UI; using System.Diagnostics;
namespace Samit.CmsProTest.School.Courses { //[AbpAuthorize(AppPermissions.Pages_Tenant_Courselevels)] public class CourseLevelAppService : CmsProTestAppServiceBase, ICourseLevelAppService { private readonly IRepository<CourseLevel> _courselevelRepository;
public CourseLevelAppService(IRepository<CourseLevel> courselevelRepository)
//public CourseAppService(IRepository<Course> courseRepository, IRepository<CourseDetail> coursedetailRepository, IRepository<CourseEdu> courseeduRepository, IRepository<Educator> educatorRepository)
{
_courselevelRepository = courselevelRepository;
}
public ListResultDto<CourseLevelListDto> GetCourseLevel(GetCoursesInput input)
{
var courseslevel = _courselevelRepository
.GetAll()
.Where(p => p.Type == input.type)
.WhereIf(
!input.Filter.IsNullOrEmpty(),
p => p.Name.Contains(input.Filter)
)
.OrderBy(p => p.Id)
.ToList();
return new ListResultDto<CourseLevelListDto>(courseslevel.MapTo<List<CourseLevelListDto>>());
}
public async Task<CourseLevelListDto> GetCourseLevelForEdit(GetCoursesInput input)
{
var @courselevel = await _courselevelRepository
.GetAll()
.Where(e => e.Id == input.Id)
.FirstOrDefaultAsync();
if (@courselevel == null)
{
throw new UserFriendlyException("courselevel Could not be found, maybe it's deleted.");
}
return @courselevel.MapTo<CourseLevelListDto>();
}
public async Task CreateOrUpdateCourseLevel(CreateCourseLevelinput input)
{
if (input.Id.HasValue)
{
await UpdateCourseLevelAsync(input);
}
else
{
await CreateCourseLevelAsync(input);
}
}
[AbpAuthorize(AppPermissions.Pages_Tenant_Courselevels_Edit)]
protected virtual async Task UpdateCourseLevelAsync(CreateCourseLevelinput input)
{
Debug.Assert(input.Id != null, "input.CourseLevel.Id should be set.");
var courselevel = _courselevelRepository.FirstOrDefault(Convert.ToInt32(input.Id));
courselevel.Name = input.Name;
courselevel.CourseDesc = input.CourseDesc;
courselevel.ARCourseDesc = input.ARCourseDesc;
courselevel.ARName = input.ARName;
courselevel.Active = input.Active;
courselevel.Type = input.Type;
courselevel.Image = input.Image;
await _courselevelRepository.UpdateAsync(courselevel);
}
[AbpAuthorize(AppPermissions.Pages_Tenant_Courselevels_Create)]
public async Task CreateCourseLevelAsync(CreateCourseLevelinput input)
{
var courselevel = input.MapTo<CourseLevel>();
await _courselevelRepository.InsertAsync(courselevel);
}
[AbpAuthorize(AppPermissions.Pages_Tenant_Courselevels_Delete)]
public async Task DeleteCourseLevel(GetCoursesInput input)
{
await _courselevelRepository.DeleteAsync(Convert.ToInt32(input.Id));
}
}
}
when i try the image upload from my page for example catalog and browse and select an image it gives the following 2 error
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
1Proxy_5.ExecuteAsync_callback(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at Castle.Proxies.Invocations.ApiController_ExecuteAsync_5.InvokeMethodOnTarget()\r\n at Castle.DynamicProxy.AbstractInvocation.Proceed()\r\n at Abp.WebApi.Controllers.Dynamic.Interceptors.AbpDynamicApiControllerInterceptor
1.Intercept(IInvocation invocation)\r\n at Castle.DynamicProxy.AbstractInvocation.Proceed()\r\n at Castle.Proxies.DynamicApiController`1Proxy_5.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.yes,
i do have a Temp\Downloads folder and i get this error, i am using Angulatjs SPA application. even from my other pages i am not able to load images.
i have sent the credentials to login in to the site at you email. you can try to login and see the error i get.
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
Regards Anwar