1

I have been trying to upload a file to our SharePoint server for a couple of weeks with no success. I have read several post on here and elsewhere but I cannot see to get it to work.

These are the commands I have been trying with the outputs. Please, can someone tell me where I am going wrong?

curl -L -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" -O --user domain/username:password -T failed.csv https://mysite.sharepoint.com/sites/testwebhook/Shared%20Documents/General/failed.csv -vvv


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to mysite.sharepoint.com port 443 (#0)
*   Trying xxx.xxx.xxx.xxx...
* Connected to mysite.sharepoint.com (xxx.xxx.xxx.xxx) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=*.sharepoint.com,OU=Microsoft Corporation,O=Microsoft Corporation,L=Redmond,ST=WA,C=US
*       start date: Mar 07 21:35:03 2018 GMT
*       expire date: Mar 06 21:35:03 2020 GMT
*       common name: *.sharepoint.com
*       issuer: CN=Microsoft IT TLS CA 1,OU=Microsoft IT,O=Microsoft Corporation,L=Redmond,ST=Washington,C=US
* Server auth using Basic with user 'domain/username'
> PUT /sites/testwebhook/Shared%20Documents/General/failed.csv HTTP/1.1
> Authorization: Basic c3BvcnRwZXNhLmNvbS9waGlsLmJyYWR5QDp6R0FWYnRmN2Y2Z1FjbEJFdG9Udw==
> User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
> Host: mysite.sharepoint.com
> Accept: */*
> Content-Length: 1633
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [data not shown]
* We are completely uploaded and fine
< HTTP/1.1 302 Found
< Content-Length: 272
< Content-Type: text/html; charset=utf-8
< Location: https://mysite.sharepoint.com/sites/testwebhook/_layouts/15/Authenticate.aspx?Source=%2Fsites%2Ftestwebhook%2FShared%20Documents%2FGeneral%2Ffailed%2Ecsv
< P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
< X-SharePointHealthScore: 2
< SPRequestGuid: fa84a49e-e046-0000-38b8-14009af2f9eb
< request-id: fa84a49e-e046-0000-38b8-14009af2f9eb
< MS-CV: nqSE+kbgAAA4uBQAmvL56w.0
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.8314
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: 60B7BACBCB0F48ADB6510D0754726C3E Ref B: LON21EDGE0609 Ref C: 2018-11-21T11:58:29Z
< Date: Wed, 21 Nov 2018 11:58:29 GMT
<
* Ignoring the response-body
{ [data not shown]
100  1905  100   272  100  1633    940   5644 --:--:-- --:--:-- --:--:--  5650
* Connection #0 to host mysite.sharepoint.com left intact
* Issue another request to this URL: 'https://mysite.sharepoint.com/sites/testwebhook/_layouts/15/Authenticate.aspx?Source=%2Fsites%2Ftestwebhook%2FShared%20Documents%2FGeneral%2Ffailed%2Ecsv'
* Found bundle for host mysite.sharepoint.com: 0x11eb340
* Re-using existing connection! (#0) with host mysite.sharepoint.com
* Connected to mysite.sharepoint.com (xxx.xxx.xxx.xxx) port 443 (#0)
* Server auth using Basic with user 'domain:'
> PUT /sites/testwebhook/_layouts/15/Authenticate.aspx?Source=%2Fsites%2Ftestwebhook%2FShared%20Documents%2FGeneral%2Ffailed%2Ecsv HTTP/1.1
> Authorization: Basic c3BvcnRwZXNhLmNvbS9waGlsLmJyYWR5QDp6R0FWYnRmN2Y2Z1FjbEJFdG9Udw==
> User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
> Host: mysite.sharepoint.com
> Accept: */*
> Content-Length: 1633
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [data not shown]
* We are completely uploaded and fine
< HTTP/1.1 405 Method Not Allowed
< Allow: GET, HEAD, OPTIONS, TRACE
< P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
< X-SharePointHealthScore: 2
< SPRequestGuid: fa84a49e-f044-0000-38b8-1bd5894edf98
< request-id: fa84a49e-f044-0000-38b8-1bd5894edf98
< MS-CV: nqSE+kTwAAA4uBvViU7fmA.0
< Strict-Transport-Security: max-age=31536000
< X-FRAME-OPTIONS: SAMEORIGIN
< SPRequestDuration: 15
< SPIisLatency: 2
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.8314
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: 3DB34D91446A4556978DF6B7BABD5907 Ref B: LON21EDGE0609 Ref C: 2018-11-21T11:58:29Z
< Date: Wed, 21 Nov 2018 11:58:29 GMT
< Content-Length: 0
<
100  1633    0     0  100  1633      0   4842 --:--:-- --:--:-- --:--:--  4842
* Connection #0 to host mysite.sharepoint.com left intact

AND

curl --ntlm --user domain/username:password -T failed.csv https://mysite.sharepoint.com/sites/testwebhook/Shared-Documents/General/failed.csv -vvv
* About to connect() to mysite.sharepoint.com port 443 (#0)
*   Trying xxx.xxx.xxx.xxx...
* Connected to mysite.sharepoint.com (13.107.136.9) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=*.sharepoint.com,OU=Microsoft Corporation,O=Microsoft Corporation,L=Redmond,ST=WA,C=US
*       start date: Mar 07 21:35:03 2018 GMT
*       expire date: Mar 06 21:35:03 2020 GMT
*       common name: *.sharepoint.com
*       issuer: CN=Microsoft IT TLS CA 1,OU=Microsoft IT,O=Microsoft Corporation,L=Redmond,ST=Washington,C=US
* Server auth using NTLM with user 'domain/username'
> PUT /sites/testwebhook/Shared-Documents/General/failed.csv HTTP/1.1
> Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
> User-Agent: curl/7.29.0
> Host: mysite.sharepoint.com
> Accept: */*
> Content-Length: 0
> Expect: 100-continue
>
< HTTP/1.1 401 Unauthorized
< P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
< SPRequestGuid: 4786a49e-803d-0000-38b8-19cb846bfe9d
< request-id: 4786a49e-803d-0000-38b8-19cb846bfe9d
< MS-CV: nqSGRz2AAAA4uBnLhGv+nQ.0
< Strict-Transport-Security: max-age=31536000
< X-FRAME-OPTIONS: SAMEORIGIN
< SPRequestDuration: 65
< SPIisLatency: 2
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.8314
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: 5387A1C54284471AA82105ED1FBDC2B1 Ref B: LON21EDGE1107 Ref C: 2018-11-21T12:21:13Z
< Date: Wed, 21 Nov 2018 12:21:12 GMT
< Content-Length: 0
<
* Connection #0 to host mysite.sharepoint.com left intact

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.