From 558a8957f9f6823b8e8e6fc583e829c4f4dcebc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 7 Dec 2016 10:59:16 +0100 Subject: [PATCH] Fix docs for OctoPrint.upload method --- docs/jsclientlib/base.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/jsclientlib/base.rst b/docs/jsclientlib/base.rst index 65a56340..9b1184e6 100644 --- a/docs/jsclientlib/base.rst +++ b/docs/jsclientlib/base.rst @@ -255,14 +255,18 @@ **Example:** - Uploading a file from a file input element, updating a label with the current upload progress. + Uploading a file to ``some/path`` on the blueprint of plugin ``myplugin``, from a file input element, + updating a label with the current upload progress. .. code-block:: javascript var fileInput = $("#my-file-input"); var progressOutput = $("#progress-output"); - OctoPrint.upload("/plugins/myplugin/some/path", fileInput, "myfilename.dat", {"somekey": "somevalue"}) + OctoPrint.upload(OctoPrint.getBlueprintUrl("myplugin") + "some/path", + fileInput, + "myfilename.dat", + {"somekey": "somevalue"}) .progress(function(data) { if (data.total) { var percentage = Math.round(data.loaded * 100 / data.total); @@ -277,7 +281,7 @@ progressOutput.text("Uploaded!"); }); - :param string url: The URL to ``POST`` the upload to + :param string url: URL to which to POST the upload, relative to base url or absolute :param object file: The file to object, see description for details :param string filename: An optional file name to use for the upload :param object additional: An optional object of additional key/value pairs to set on the uploaded form data