Don't think you can upload a kml as far as i know it is supported as output
format only.
Try with a shp file instead.
Cheers,
Carlo
Il 14/feb/2014 18:38 "tt5430" <tt9...@gmail.com> ha scritto:

> Hi Mauro,
>
> Thanks for you help.  I tried to upload a kml file from a local machine to
> geoserver installed on other machine and got errors that I don't know why.
> Below was what I did:
>
> 1. I created a workspace named "kmls" using:
>
> curl -v -u admin:geoserver -XPOST -H "Content-type: text/xml"  -d 
> "<workspace><name>kmls</name></workspace>"  
> http://172.16.203.30:8080/geoserver/rest/workspaces
>
> 2. cd to a directory where that kml file is located.
>
> 3. executed the following curl command:
> $ curl -v -u admin:geoserver -XPUT -H "Content-type: text/xml" -d 
> @BalloonLinks.kml 
> http://172.16.203.30:8080/geoserver/rest/workspaces/kmls/datastores/kmls/file.xml
>
> * timeout on name lookup is not supported
> * About to connect() to 172.16.203.30 port 8080 (#0)
> *   Trying 172.16.203.30...
> * connected
> * Connected to 172.16.203.30 (172.16.203.30) port 8080 (#0)
> * Server auth using Basic with user 'admin'
>
> > PUT /geoserver/rest/workspaces/kmls/datastores/kmls/file.xml HTTP/1.1
> > Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> > User-Agent: curl/7.26.0
> > Host: 172.16.203.30:8080
>
> > Accept: */*
> > Content-type: text/xml
> > Content-Length: 7583
> > Expect: 100-continue
> >
> < HTTP/1.1 100 Continue
> < HTTP/1.1 400 Bad Request
> < Server: Apache-Coyote/1.1
> < Content-Type: text/plain
>
> < Transfer-Encoding: chunked
> < Date: Wed, 12 Feb 2014 16:16:07 GMT
> < Connection: close
> <
> Unsupported format: xml* we are done reading and this is set to close, stop 
> send
> * Closing connection #0
>
> What did I do wrong?
>
> Regards,
>
> -Tam
>
>
>
>
>
> On Wed, Feb 12, 2014 at 4:12 AM, Mauro Bartolomeoli-3 [via OSGeo.org] <[hidden
> email] <http://user/SendEmail.jtp?type=node&node=5103434&i=0>> wrote:
>
>> Hi Tam,
>>
>>
>> 2014-02-12 6:04 GMT+01:00 tt5430 <[hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5103352&i=0>
>> >:
>>
>> All,
>>>
>>> I am trying to find a way for the users to upload files such as GeoTiff,
>>> kml, etc. from client machine onto GeoServer workspace and wondering
>>> whether
>>> I can use GeoServer REST PUT operation for that.
>>>
>>> Below is an example of the REST PUT operation using curl taken from
>>> GeoServer's REST examples.
>>>
>>> curl -v -u admin:geoserver -XPUT -H "Content-type: application/zip"
>>>   --data-binary @roads.zip
>>>
>>>
>>> http://localhost:8080/geoserver/rest/workspaces/acme/datastores/roads/file.shp
>>>
>>>  I known that "@roads.zip" indicates the zip file to be uploaded.  But
>>> where
>>> is the file?  Is it it relative to some path?
>>>
>>
>> It is relative to the path you are launching curl from. You can also
>> specify an absolute path.
>>
>>
>>> and what is the last line?  Is it always "
>>> http://localhost:8080/geoserver";?
>>>
>>
>> It is the url of the geoserver you need to configure with the new
>> shapefile. That one is the default url when you install the standalone
>> geoserver locally on your PC.
>> Do you have a geoserver installed on some server?
>>
>>
>>> I could not find any examples from the internet showing how to use REST
>>> PUT
>>> to upload files from client machine.  Can some clarify this?  If it can
>>> be
>>> done with GeoServer REST API, I greatly appreciated an example in curl.
>>>
>>
>> On the same page you found the shapefile example (
>> http://docs.geoserver.org/latest/en/user/rest/examples/curl.html), you
>> can find other examples  for other types of data.
>> In this other documentation page (
>> http://docs.geoserver.org/latest/en/user/rest/) you can find a reference
>> for all the supported rest requests. For example to upload a geotiff you
>> will need a coveragestore PUT request.
>>
>>
>> Cheers,
>> Mauro
>>
>>
>>
>> --
>> ==
>> Our support, Your Success! Visit http://opensdi.geo-solutions.it for
>> more information.
>> ==
>>
>> Dott. Mauro Bartolomeoli
>> @mauro_bart
>> Senior Software Engineer
>>
>> GeoSolutions S.A.S.
>> Via Poggio alle Viti 1187
>> 55054  Massarosa (LU)
>> Italy
>> phone: <a href="tel:%2B39%200584%20962313" value="+390584962313"
>> target="_blank">+39 0584 962313
>> fax:     <a href="tel:%2B39%200584%201660272" value="+3905841660272"
>> target="_blank">+39 0584 1660272
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> -------------------------------------------------------
>>
>> ------------------------------------------------------------------------------
>>
>> Android apps run on BlackBerry 10
>> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
>> Now with support for Jelly Bean, Bluetooth, Mapview and more.
>> Get your Android app in front of a whole new audience.  Start now.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Geoserver-users mailing list
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5103352&i=1>
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://osgeo-org.1560.x6.nabble.com/REST-PUT-to-upload-files-from-client-machine-tp5103281p5103352.html
>>  To unsubscribe from REST PUT to upload files from client machine, click
>> here.
>> NAML<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> ------------------------------
> View this message in context: Re: REST PUT to upload files from client
> machine<http://osgeo-org.1560.x6.nabble.com/REST-PUT-to-upload-files-from-client-machine-tp5103281p5103434.html>
> Sent from the GeoServer - User mailing list 
> archive<http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html>at 
> Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to