[GeoNode-users] Upload a document into Geonode through Javascript Rest API

Pankaj Sharma Pankaj.Sharma at auckland.ac.nz
Thu Feb 17 15:34:46 PST 2022


Hello,

I attended the last webinar. I was asking the question reading uploading a GeoNode document through the REST Upload endpoint using JavaScript through the Web interface.
I can upload a zipped shapefile (stored as a JavaScript variable) from the GeoNode Layers upload page using the GeoServer REST API endpoint.
>From that same Uploads Layer page, I also have a document (also stored as a JavaScript variable) which I want to upload - this time in GeoNode.
I basically want to upload the document as a GeoNode document using JavaScript.

Last week, I have posted this question on Gitter as well.
I found an earlier Gitter post focusing on this topic. https://gitter.im/GeoNode/general?at=60046313e578cf1e95f3bf7e
A method pointed out is from: https://stackoverflow.com/questions/20473572/django-rest-framework-file-upload
However, someone else has pointed out that the above solution seems to work for DRF but is most likely not yet implemented [in GeoNode].

What does that mean that it is not implemented? Does it mean we can implement is using the code sample or does it mean that even if we implement the code, it wouldn't work?

Another aspect of this is that we want this upload feature to be  secure. Since we are using javascript, we don't want the credentials used for upload be visible in plaintext.
Thus, is there a way we can get a token of the current logged-in user?

I am just hoping to know if this is indeed implemented and if the approach pointed out is worth a try.

Dr Pankaj Sharma
Research Fellow
Department of Environment
The University of Auckland
Auckland, New Zealand

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20220217/971174cd/attachment.html>


More information about the geonode-users mailing list