CrossGeeks / FileUploaderPlugin

Simple cross platform plugin to upload files.
MIT License
68 stars 27 forks source link

I have pass all headers still getting "Authorization has been denied for this request" error always. I'm trying to uploading image #29

Open divyesh008 opened 5 years ago

divyesh008 commented 5 years ago

If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.

Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.

Bug Information

Version Number of Plugin: 1.4.0 Device Tested On: iPhone 6 Simulator Tested On: Version of VS: 8.0.2 (build 23) Version of Xamarin:12.8.0.0 Versions of other things you are using: Operating System Mac OS X 10.14.3 Darwin 18.2.0 Darwin Kernel Version 18.2.0

Steps to reproduce the Behavior

Use this plugin for upload document and images

Expected Behavior

Upload file and show progress bar and after success show success message

Actual Behavior

getting "Authorization has been denied for this request" error always

Code snippet

Dictionary<string, string> headers = new Dictionary<string, string>(); headers.Add("Authorization", AccountInfo.AccessToken); headers.Add("Content-Type", "application/x-www-form-urlencoded");

        CrossFileUploader.Current.UploadFileAsync(GlobalConstant.ApiUrl + "/api/files/proposalGroup?proposalId=" + ProposalId, new FileBytesItem("document1", docData, filename), headers);

        CrossFileUploader.Current.FileUploadCompleted +=(sender, e) => 
        {
            //Hide Progress bar
        };
        CrossFileUploader.Current.FileUploadError += (sender, e) => 
        { 
        };
        CrossFileUploader.Current.FileUploadProgress +=(sender, e) => 
        { 
            //show progress bar
        };

Screenshotst