Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "avanekar02"

Answer

Please respond to the error JSON

Answer

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

Answer

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);
      
            }
        };
Answer

another full image with error

Answer

This is the error with the url

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&lt;CourseLevel&gt; courselevelRepository)
    //public CourseAppService(IRepository&lt;Course&gt; courseRepository, IRepository&lt;CourseDetail&gt; coursedetailRepository, IRepository&lt;CourseEdu&gt; courseeduRepository, IRepository&lt;Educator&gt; educatorRepository)
    {
        _courselevelRepository = courselevelRepository;
   
    }



    public ListResultDto&lt;CourseLevelListDto&gt; 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&lt;CourseLevelListDto&gt;(courseslevel.MapTo&lt;List&lt;CourseLevelListDto&gt;>());
    }



    public async Task&lt;CourseLevelListDto&gt; 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&lt;CourseLevelListDto&gt;();
    }



    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&lt;CourseLevel&gt;();
        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

  1. Server Error in '/' Application.

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.

  1. {"message":"An error has occurred.","exceptionMessage":"There is an action CreateOrUpdateCourseLevel defined for api controller app/courseLevel but with a different HTTP Verb. Request verb is GET. It should be Post","exceptionType":"Abp.AbpException","stackTrace":" at Abp.WebApi.Controllers.Dynamic.Selectors.AbpApiControllerActionSelector.GetActionDescriptorByActionName(HttpControllerContext controllerContext, DynamicApiControllerInfo controllerInfo, String actionName)\r\n at Abp.WebApi.Controllers.Dynamic.Selectors.AbpApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at Castle.Proxies.DynamicApiController1Proxy_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.AbpDynamicApiControllerInterceptor1.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

This is the error thrown when i try to change a profile picture or upload an image.

Please tell how to overcome this

Regards Anwar

Showing 161 to 170 of 185 entries