Lookup table update via PHP

I was trying to upload the look up table using php. I first tried this in
my terminal. But nothing happens. Did I missed something?

https://confluence.dimagi.com/display/commcarepublic/Bulk+upload+Lookup+Tables

What I type:

curl -v --digest https://www.commcarehq.org/a/myproject/fixtures/fixapi/ -u
myusername@xxx.xxx:mypassword -F
"file-to-upload=@/home/campus/sss/www/lookup.xlsx" -F “replace=true”

What I get from the terminal:

  • About to connect() to www.commcarehq.org port 443 (#0)

  • Trying 146.20.47.186… connected

  • Connected to www.commcarehq.org (146.20.47.186) 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=*.commcarehq.org,O=Dimagi
    Inc,L=Cambridge,ST=Massachusetts,C=US

  • start date: Nov 11 00:00:00 2016 GMT

  • expire date: Dec 30 23:59:59 2017 GMT

  • common name: *.commcarehq.org

  • issuer: CN=thawte SSL CA - G2,O=“thawte, Inc.”,C=US

  • Server auth using Digest with user ‘wXXXX@####.***marked’

POST /a/hrd-purdue-scm/fixtures/fixapi/ HTTP/1.1

User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7
NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

Host: www.commcarehq.org

Accept: /

Content-Length: 0

< HTTP/1.1 401 Unauthorized

< Server: nginx/1.10.1

< Date: Thu, 29 Jun 2017 05:30:29 GMT

< Content-Type: text/html; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Content-Language: en

< Expires: Thu, 01 Dec 1994 16:00:00 GMT

< Vary: Accept-Language, Cookie

< Pragma: no-cache

< Cache-Control: private, no-cache, no-store, must-revalidate,
proxy-revalidate

< WWW-Authenticate: Basic realm=""

< HTTP_X_OPENROSA_VERSION: 1.0

< Set-Cookie: sessionid=xsx7ccaoump5zjphhscbrxrypm61gwm2; expires=Thu,
13-Jul-2017 05:30:29 GMT; httponly; Max-Age=1209600; Path=/

<

··· On Thursday, June 29, 2017 at 1:26:48 AM UTC-4, Wang Dawei wrote: > > I was trying to upload the look up table using php. I first tried this in > my terminal. But nothing happens. Did I missed something? > > > https://confluence.dimagi.com/display/commcarepublic/Bulk+upload+Lookup+Tables > > What I type: > > curl -v --digest https://www.commcarehq.org/a/myproject/fixtures/fixapi/ > -u myusername@xxx.xxx:mypassword -F > "file-to-upload=@/home/campus/sss/www/lookup.xlsx" -F "replace=true" >

Does the user you’re authenticating with have permission to edit lookup
tables?

Simon Kelly
Director of Server Engineer | Dimagi

··· On 29 June 2017 at 07:32, Wang Dawei wrote:

What I get from the terminal:

  • About to connect() to www.commcarehq.org port 443 (#0)

  • Trying 146.20.47.186… connected

  • Connected to www.commcarehq.org (146.20.47.186) 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=*.commcarehq.org,O=Dimagi Inc,L=Cambridge,ST=
    Massachusetts,C=US

  • start date: Nov 11 00:00:00 2016 GMT

  • expire date: Dec 30 23:59:59 2017 GMT

  • common name: *.commcarehq.org

  • issuer: CN=thawte SSL CA - G2,O=“thawte, Inc.”,C=US

  • Server auth using Digest with user ‘wXXXX@####.***marked’

POST /a/hrd-purdue-scm/fixtures/fixapi/ HTTP/1.1

User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7
NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

Host: www.commcarehq.org

Accept: /

Content-Length: 0

< HTTP/1.1 401 Unauthorized

< Server: nginx/1.10.1

< Date: Thu, 29 Jun 2017 05:30:29 GMT

< Content-Type: text/html; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Content-Language: en

< Expires: Thu, 01 Dec 1994 16:00:00 GMT

< Vary: Accept-Language, Cookie

< Pragma: no-cache

< Cache-Control: private, no-cache, no-store, must-revalidate,
proxy-revalidate

< WWW-Authenticate: Basic realm=""

< HTTP_X_OPENROSA_VERSION: 1.0

< Set-Cookie: sessionid=xsx7ccaoump5zjphhscbrxrypm61gwm2; expires=Thu,
13-Jul-2017 05:30:29 GMT; httponly; Max-Age=1209600; Path=/

<

On Thursday, June 29, 2017 at 1:26:48 AM UTC-4, Wang Dawei wrote:

I was trying to upload the look up table using php. I first tried this in
my terminal. But nothing happens. Did I missed something?

https://confluence.dimagi.com/display/commcarepublic/Bulk+up
load+Lookup+Tables

What I type:

curl -v --digest https://www.commcarehq.org/a/myproject/fixtures/fixapi/
-u myusername@xxx.xxx:mypassword -F “file-to-upload=@/home/campus/sss/www/lookup.xlsx”
-F “replace=true”


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.