Ok so I changed a bit more of my code,

curl -u admin:geoserver -v -XPUT -H 'Content-type: application/zip'
--data-binary '/var/www/geo/shapefile/zip/Poa_horridula.zip'
http://localhost:8080/geoserver/rest/workspaces/acme/datastores/newtest/file.shp

And now the error is that the file cannot be unzipped.

* About to connect() to localhost port 8080 (#0)
*   Trying ::1... connected
* Server auth using Basic with user 'admin'
> PUT /geoserver/rest/workspaces/acme/datastores/newtest/file.shp HTTP/1.1
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: */*
> Content-type: application/zip
> Content-Length: 44
>
* upload completely sent off: 44out of 44 bytes
< HTTP/1.1 500 Internal Server Error
< Server: Apache-Coyote/1.1
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Date: Tue, 13 Nov 2012 23:12:47 GMT
< Connection: close
<
* Closing connection #0
Error occured unzipping file:error in opening zip file

Any idea why it is unable to unzip it?

Thanks,
Smaran

On Tue, Nov 13, 2012 at 3:36 PM, Smaran Harihar <[email protected]>wrote:

> Ok cheesy,
>
> I gave up on uploading the individual shapefile and tried to upload a
> zipped shapefile and still I am not able to succeed.
>
> I am implementing the following code to upload a zipped shapefile as per
> the 
> documentation<http://docs.geoserver.org/stable/en/user/restconfig/rest-config-examples/rest-config-examples-curl.html#uploading-a-shapefile>
> ,
>
> *    curl -u admi PUT 'Content-type: application/zip' --data-binary
> @/var/www/geo/shapefile/zip/Poa_horridula.zip
> http://localhost:8080/geoserver/rest/workspaces/acme/datastores/Poa_horridula/Poa_horridula.zip
> *
>
> But I am getting following error,
>
> > curl: (6) Couldn't resolve host 'Content-type'
> >> No such datastore: acme,Poa_horridula
>
> The document says that the curl code will create the datastore then why am
> I getting this error?
>
> Where am I going wrong?
>
> Thanks,
> Smaran
>
> On Fri, Nov 9, 2012 at 7:26 PM, cheesybiscuits 
> <[email protected]>wrote:
>
>> Yes I would expect your new command to work fine but there are a few
>> possible
>> explanations for why it might fail.
>>
>> 1) the target of your new path is different to your original relative
>> path -
>> I assume /var/www/geo/shapefile/csvQshp/ does actually contain shapefiles
>> 2) you might be seeing permissions issues where Tomcat (or whatever your
>> container is) can't read the data. If safe to do so you might want to
>> verify
>> this by opening up privileges, e.g. something like chmod -R 0744
>> /var/www/geo/shapefile/csvQshp
>> 3) as the datastore is created I assume there are no permissions issues
>> with
>> Tomcat / whatever writing to the target directory
>>
>> If you're still having trouble I would test by identifying a single
>> shapefile, rather than the directory
>>
>> curl -u admin:geoserver -XPUT -H 'Content-type: text/plain' -d
>> 'file:///var/www/geo/shapefile/csvQshp/someshape.shp'
>> "
>> http://localhost:8080/geoserver/rest/workspaces/acme/datastores/csvQshp/external.shp?configure=all
>> "
>>
>>
>>


-- 
Thanks & Regards
Smaran Harihar
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to