Permalink
Browse files

Fix docs for OctoPrint.upload method

  • Loading branch information...
1 parent 8d2681a commit 558a8957f9f6823b8e8e6fc583e829c4f4dcebc8 @foosel committed Dec 7, 2016
Showing with 7 additions and 3 deletions.
  1. +7 −3 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

0 comments on commit 558a895

Please sign in to comment.