1

i am using the onedrive filepicker for javascript

i developed a website where you can save a file directly 1. using the input element 2. changing the file to dataURI format and saving it to onedrive.

using the input element is working perfectly fine

but when i want to change to dataURI and save i get this error from the browser

Error 756 Too long request String

enter image description here

basically i uploading a .docx file and converting to dataURI and requesting save using the filepicker the dataURI is passed to the url request String which becomes very long

but upon some research based on this question

What is the maximum possible length of a query string?

the limit for chrome is 64k characters but when i counted the length of my request url it was 20,102

enter image description here

here is how the one drive file picker works you pass the parameters to an object and pass the function to onedrive.save function which takes care of everything including the calls and authentication also

  var odOptions = {
                          clientId: "1fd8b6bd-4585-4491-a802-7bc9f0fde5da",
                          action: "save",
                       // sourceInputElementId: "",
                          sourceUri: data,
                          fileName: "fil.txt",
                          openInNewWindow: true,
                          advanced: {},
                          success: function(files) { console.log('success');},
                          progress: function(p) { console.log("2"); },
                          cancel: function() {console.log("3"); },
                          error: function(e) { console.log(e); }
                        };

                        console.log("6");
                      OneDrive.save(odOptions);

can you help me why this is happening and how to solve this problem ?

my final aim is that in my other application i get the files from a server in the form of dataURIs and i want to save these to one drive

is there any other solution ?

you can test the website here https://bandrevu-akhil.github.io/

Community
  • 1
  • 1

0 Answers0