1. #21
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    Robin-Hood is on a distinguished road

      0  

    Default


    I used xmlhttprequest to send the files to my server, the code looked like this:
    Code:
    load     : function(cmp, e, file) {
                console.log("Done Reading");
                var formData = new FormData();
                var xhr = new XMLHttpRequest();
    
    
                var onProgress = function(e) {
                  if (e.lengthComputable) {
                    var percentComplete = (e.loaded/e.total)*100;
                  }
                };
    
    
                var onReady = function(e) {
                 // ready state
                };
    
    
                var onError = function(err) {
                  // something went wrong with upload
                };
    
    
                formData.append('files', file);
                xhr.open('post', '/upload', true);
                xhr.addEventListener('error', onError, false);
                xhr.addEventListener('progress', onProgress, false);
                xhr.send(formData);
                xhr.addEventListener('readystatechange', onReady, false);
    
    
            },
    The chrome debugger says the upload was cancelled but all files arrive in full on server side (maybe it says cancelled from lack of response?)
    I'm using node.js server side if anyone is interested the code there uses formidable and looks like this:
    Code:
    var form = new formidable.IncomingForm();
      form.uploadDir = __dirname + '/testUpload';
      form.encoding = 'utf-8';
      form.keepExtensions = true;
    
    
      form.hash = false;
      form.on('fileBegin', function(field, file) {
                    file.path = form.uploadDir + '/' + file.name;
                    console.log("File Upload Started");
                  });
      form.addListener('file', function(name, file) {
                    console.log(file.path);
       });             
      form.addListener('end', function() {
        res.end();
      });
    
    
      form.parse(req, function(err, fields, files) {
        if (err) {
          console.log(err);
        }
    Thanks

  2. #22
    Sencha User
    Join Date
    Sep 2014
    Posts
    1
    Vote Rating
    0
    myvista is on a distinguished road

      0  

    Default


    hello
    I am trying to learn extjs framework
    I am trying to install your plugin, but a reseived error
    Uncaught TypeError: undefined is not a function main.js:3
    Ext.onReady(function() {
    var panel = new Ext.Panel({
    renderTo : Ext.getBody(),
    width : 400,
    height : 400,
    html : "Test",
    title : "File Droppable",
    plugins : [
    { ptype : "filedrop" }
    ],
    listeners : {
    dragover : function(cmp, e) {
    console.log("Dragging");
    },
    drop : function(cmp, e) {
    console.log("Drop");
    }
    }
    });
    });

    what can I do incorrect.

  3. #23
    Sencha User olecom's Avatar
    Join Date
    Oct 2011
    Location
    Republic of Belarus
    Posts
    40
    Vote Rating
    2
    olecom is on a distinguished road

      0  

    Default


    Quote Originally Posted by Robin-Hood View Post
    I'm using node.js server side if anyone is interested the code there uses formidable and looks like this:
    Maybe try http://github.com/mscdex/busboy ?

Similar Threads

  1. Highcharts adapter and plugin for ExtJS
    By buz in forum Ext 3.x: User Extensions and Plugins
    Replies: 427
    Last Post: 18 Jul 2013, 9:03 AM
  2. Eclipse's Extjs plugin anybody knows one?
    By andredecotia in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 15 Dec 2010, 5:40 AM
  3. How to create plugin for ExtJS
    By martinfeng in forum Ext 3.x: User Extensions and Plugins
    Replies: 4
    Last Post: 7 Nov 2010, 9:16 AM
  4. rwt (a ruby on rails plugin for extjs)
    By twr in forum Community Discussion
    Replies: 1
    Last Post: 12 Feb 2009, 2:28 AM

Thread Participants: 6