SharePoint Online: Uploading file using FrontPage Server Extenstion Put document method

Sanjay Kumar R 81 Reputation points
2021-02-25T05:14:57.347+00:00

Hi,

I am trying to upload a file to SharePoint server using FrontPage Server Extenstion Put document method. I followed the below document,

https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ms479623(v=office.14)

I am able to create the file successfully on the SharePoint using libcurl and postman, but I am not sure how to pass the file content in the body. Could anyone guide me how to do it?

Regards,
Sanjay

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,595 questions
{count} votes

Accepted answer
  1. Jerryzy 10,561 Reputation points
    2021-02-25T07:42:12.533+00:00

    Hi @Sanjay Kumar R ,

    The File Content in the request body should be the file binary stream data, in PostMan, you can select a specific file and will automatically convert as binary data, you can test it.

    Here is the summary to upload a file:

    POST https://{site_url}/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files/Add(url='{file_name}', overwrite=true)  
    Authorization: "Bearer " + accessToken  
    Content-Length: {length of request body as integer}  
    X-RequestDigest: "{form_digest_value}"  
      
    Contents of binary file  
    

    71978-snipaste-2021-02-25-15-38-31.png

    And before uploading file, it's necessary to get request digest value and use as X-RequestDigest in request header, here is a blog with detailed steps, I suggest you can refer for detailed information:

    SharePoint Online remote authentication (and Doc upload)

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful