Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix README. Add an example.

  • Loading branch information...
commit 04215cebc6e05dfc363fcfc6bab87ab47134c584 1 parent 93596b8
Matt Kane ascorbic authored
22 iPhone/FileUploader/README.md
Source Rendered
@@ -17,14 +17,34 @@ The full params are as follows:
17 17
18 18 * server URL of the server that will receive the file
19 19 * file Absolute path or uri of the file to upload
20   -* fileKey Parameter name of the file
21 20 * params Object with key: value params to send to the server
  21 +* fileKey Parameter name of the file
22 22 * fileName Filename to send to the server. Defaults to image.jpg
23 23 * mimeType Mimetype of the uploaded file. Defaults to image/jpeg
24 24 * success Success callback. Passed the response data from the server as a string.
25 25 * fail Error callback. Passed the error message.
26 26 * progress Called on upload progress. Signature should be function(bytesUploaded, totalBytes)
27 27
  28 +Here is a simple example usage.
  29 +
  30 + window.plugins.fileUploader.uploadByUri('http://example.com/upload', 'file://path/to/file.jpg', {foo: 'bar'}, 'myPhoto', 'anImage.jpg', 'image/jpeg',
  31 + function(result) {
  32 + console.log('Done: ' + result);
  33 + },
  34 + function(result) {
  35 + console.log("Error: " + result);
  36 + },
  37 + function(loaded, total) {
  38 + var percent = 100 / total * loaded;
  39 + console.log('Uploaded ' + percent);
  40 +
  41 + }
  42 + );
  43 +
  44 +
  45 +
  46 +
  47 +
28 48 This is under development, and the API is likely to change.
29 49
30 50
4 iPhone/FileUploader/fileuploader.js
@@ -14,8 +14,8 @@ var FileUploader = function() {
14 14 *
15 15 * @param server URL of the server that will receive the file
16 16 * @param file file:// uri of the file to upload
17   - * @param fileKey Parameter name of the file
18 17 * @param params Object with key: value params to send to the server
  18 + * @param fileKey Parameter name of the file
19 19 * @param fileName Filename to send to the server. Defaults to image.jpg
20 20 * @param mimeType Mimetype of the uploaded file. Defaults to image/jpeg
21 21 * @param success Success callback. Passed the response data from the server as a string.
@@ -31,8 +31,8 @@ FileUploader.prototype.uploadByUri = function(server, file, params, fileKey, fil
31 31 *
32 32 * @param server URL of the server that will receive the file
33 33 * @param file Absolute path of the file to upload
34   - * @param fileKey Parameter name of the file
35 34 * @param params Object with key: value params to send to the server
  35 + * @param fileKey Parameter name of the file
36 36 * @param fileName Filename to send to the server. Defaults to image.jpg
37 37 * @param mimeType Mimetype of the uploaded file. Defaults to image/jpeg
38 38 * @param success Success callback. Passed the response data from the server as a string.

0 comments on commit 04215ce

Please sign in to comment.
Something went wrong with that request. Please try again.