Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix README. Add an example.

  • Loading branch information...
commit 04215cebc6e05dfc363fcfc6bab87ab47134c584 1 parent 93596b8
Matt Kane ascorbic authored
22 iPhone/FileUploader/README.md
View
@@ -17,14 +17,34 @@ The full params are as follows:
* server URL of the server that will receive the file
* file Absolute path or uri of the file to upload
-* fileKey Parameter name of the file
* params Object with key: value params to send to the server
+* fileKey Parameter name of the file
* fileName Filename to send to the server. Defaults to image.jpg
* mimeType Mimetype of the uploaded file. Defaults to image/jpeg
* success Success callback. Passed the response data from the server as a string.
* fail Error callback. Passed the error message.
* progress Called on upload progress. Signature should be function(bytesUploaded, totalBytes)
+Here is a simple example usage.
+
+ window.plugins.fileUploader.uploadByUri('http://example.com/upload', 'file://path/to/file.jpg', {foo: 'bar'}, 'myPhoto', 'anImage.jpg', 'image/jpeg',
+ function(result) {
+ console.log('Done: ' + result);
+ },
+ function(result) {
+ console.log("Error: " + result);
+ },
+ function(loaded, total) {
+ var percent = 100 / total * loaded;
+ console.log('Uploaded ' + percent);
+
+ }
+ );
+
+
+
+
+
This is under development, and the API is likely to change.
4 iPhone/FileUploader/fileuploader.js
View
@@ -14,8 +14,8 @@ var FileUploader = function() {
*
* @param server URL of the server that will receive the file
* @param file file:// uri of the file to upload
- * @param fileKey Parameter name of the file
* @param params Object with key: value params to send to the server
+ * @param fileKey Parameter name of the file
* @param fileName Filename to send to the server. Defaults to image.jpg
* @param mimeType Mimetype of the uploaded file. Defaults to image/jpeg
* @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
*
* @param server URL of the server that will receive the file
* @param file Absolute path of the file to upload
- * @param fileKey Parameter name of the file
* @param params Object with key: value params to send to the server
+ * @param fileKey Parameter name of the file
* @param fileName Filename to send to the server. Defaults to image.jpg
* @param mimeType Mimetype of the uploaded file. Defaults to image/jpeg
* @param success Success callback. Passed the response data from the server as a string.
Please sign in to comment.
Something went wrong with that request. Please try again.