Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. upload = function (imageURI) {
  2. var ft = new FileTransfer(),
  3. options = new FileUploadOptions();
  4.  
  5. options.fileKey = "file";
  6. options.fileName = 'filename.jpg'; // We will use the name auto-generated by Node at the server side.
  7. options.mimeType = "image/jpeg";
  8. options.chunkedMode = false;
  9. options.params = { // Whatever you populate options.params with, will be available in req.body at the server-side.
  10. "description": "Uploaded from my phone"
  11. };
  12.  
  13. // alert(imageURI);
  14. // alert(serverURL);
  15.  
  16. ft.upload(imageURI, serverURL + "/images",
  17. function (e) {
  18. getFeed();
  19. },
  20. function (e) {
  21. alert("Upload failed");
  22. }, options);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement