0

I need to be able to set certain column details when uploading documents to Sharepoint (mandatory fileds to be able to edit the files). Sharepoint headers

async uploadFile(file) {
            let data = new FormData();

            data.append('upload', file.data);
            data.append('name', file.name);
            const options = {
                headers: {
                    'Content-Type': `multipart/form-data; boundary=${
                        data._boundary
                    }`
                }
            };
            await axios.post(url, data, options); 

Is there a way that I can set the details of the file when uploading the document to sharepoint as part of that process? I have seen a few examples on the Microsoft website but they use Ajax.

2
  • I think this is not possible in single API call. So, you have to first upload the document (1st API call) & then update the document properties (2nd API call). Sep 30 '21 at 13:23
  • That's what I thought while hoping I was wrong. Thanks @GaneshSanap!
    – Alex M
    Sep 30 '21 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.