Загрузить файл с помощью Curl на linux bash не работает - PullRequest
0 голосов
/ 27 января 2020

Я пытаюсь за последние 15-20 дней, но это не получится. Пожалуйста, проверьте ниже, если нужно изменить какую-либо безопасность на стороне sharepoint или нужно изменить какие-либо команды. пожалуйста, помогите .. Пожалуйста, помогите

Я пытаюсь загрузить файл из Linux в SharePoint с моими учетными данными для входа в SharePoint. Я использую утилиту cURL для достижения этой цели. Это не удается ..

Я попытался загрузить файл с sharepoint и его загрузку очень легко, используя следующую команду

    curl -k --ntlm -u domain/username:password -O https://sharepointserver.com/sites/mysite/myfile.txt

Используется команда загрузки is:

   curl ---ntlm -u domain/username:password --upload-file myfile.txt -k "https://sharepointserver.com/sites/mysite

Вывод с использованием подробного включения:

% 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 proxy 'proxy server' port 80 (#0)
*   Trying 'Ip address'...
* Connected to proxy server (proxy Ip) port 80 (#0)
* Establish HTTP proxy tunnel to test.sharepoint.com:443
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* Server auth using NTLM with user 'domain/user'
> CONNECT test.sharepoint.com:443 HTTP/1.1
> Host: test.sharepoint.com:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
>
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0< HTTP/1.0 200 Connection established
< Set-Cookie: BIGipServerSquid_Dev_Pool=rd2319o0000000000000000000033441018o80; path=/; Httponly
<
* Proxy replied OK to CONNECT request
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* 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/user'
> GET /:x:/r/sites/TheHub/ECP/Project%20Glide/Project%20Glide%20Collaboration%20site/Shared%20Documents/14.%20Document%20and%20Records%20Management/TWS%20Reports/Development HTTP/1.1
> Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
> User-Agent: curl/7.29.0
> Host: test.sharepoint.com
> Accept: */*
>
**< 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: de7b2f9f-a041-2000-ccc6-0abdd166adb5
< request-id: de7b2f9f-a041-2000-ccc6-0abdd166adb5
< MS-CV: ny973kGgACDMxgq90WattQ.0
< Strict-Transport-Security: max-age=31536000
< X-FRAME-OPTIONS: SAMEORIGIN
< SPRequestDuration: 5
< SPIisLatency: 5
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.19708
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: 20DC3927B781464DAF54406EC7F8A4AB Ref B: LON21EDGE0516 Ref C: 2020-01-27T05:54:46Z
< Date: Mon, 27 Jan 2020 05:54:45 GMT
< Content-Length: 0
<
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host "proxyserver address" left intact

, и если я добавлю -o (small o), тогда с использованием аутентификации basi c и получим команду успешно, но файл не загружается ... ниже выводится указанная выше команда с маленьким o (-o)

% 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 proxy 'proxy server' port 80 (#0)
*   Trying Ip address...
* Connected to 'proxy server' (IP address) port 80 (#0)
* Establish HTTP proxy tunnel to test.sharepoint.com:443
* Server auth using Basic with user 'domain/user'
> CONNECT test.sharepoint.com:443 HTTP/1.1
> Host: test.sharepoint.com:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.0 200 Connection established
< Set-Cookie: BIGipServerSquid_Dev_Pool=rd2319o00000000000000000000ffff0add1018o80; path=/; Httponly
<
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* 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/user'
> PUT /:x:/r/sites/TheHub/ECP/Project%20Glide/Project%20Glide%20Collaboration%20site/Shared%20Documents/14.%20Document%20and%20Records%20Management/TWS%20Reports/Development HTTP/1.1
> Authorization: Basic Z2JidXBhZ3JvdXAvc2F3YW50bjozbWF0b231ml2QVNAQEBA
> User-Agent: curl/7.29.0
> Host: test.sharepoint.com
> Accept: */*
> Content-Length: 311
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [data not shown]
* We are completely uploaded and fine
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/plain
< Location: https://test.sharepoint.com/sites/TheHub/ECP/Project%20Glide/Project%20Glide%20Collaboration%20site/Shared%20Documents/14.%20Document%20and%20Records%20Management/TWS%20Reports/Development?cid=50561376-1bb4-4f92-be7c-0a710fb78cc3
< 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: 857c2f9f-9013-2000-6cd2-3c84489a0ad4
< request-id: 857c2f9f-9013-2000-6cd2-3c84489a0ad4
< MS-CV: ny98hROQACBs0jyESJoK1A.0
< Strict-Transport-Security: max-age=31536000
< SPRequestDuration: 5
< SPIisLatency: 5
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.19708
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< X-MSEdge-Ref: Ref A: 49395CFB685F40A184BEA4E5406D6D64 Ref B: LON21EDGE1013 Ref C: 2020-01-27T06:06:09Z
< Date: Mon, 27 Jan 2020 06:06:08 GMT
< Content-Length: 0
<
100   311    0     0  100   311      0   1323 --:--:-- --:--:-- --:--:--  1329

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...