title: EXTJS & PHP Upload file2
body: <p>I use the UploadFile example in EXTJS (<a href="http://dev.sencha.com/deploy/dev/examples/form/file-upload.html" rel="nofollow">http://dev.sencha.com/deploy/dev/examples/form/file-upload.html</a>) and i have error.</p>
  
  <p>ExtJS:</p>
  
  <pre><code> var loadfile = new Ext.FormPanel({
      fileUpload: true,
      width: 500,
      frame: true,
      title: 'Добавить фотографию',
      autoHeight: true,
      bodyStyle: 'padding: 10px 10px 0 10px;',
      labelWidth: 50,
      defaults: {
          anchor: '95%',
          allowBlank: false,
          msgTarget: 'side'
      },
      items: [
      {
          xtype: 'fileuploadfield',
          id: 'form-file',
          emptyText: 'Выберите фотографию',
          fieldLabel: 'Фото',
          name: 'userfile',
          buttonText: 'Открыть'
      }],
      buttons: [{
          text: 'Сохранить',
          handler: function(){
              if(loadfile.getForm().isValid()){
      //alert('Имя: '+loadfile.getForm().findField('userfile').getValue());
                      loadfile.getForm().submit({
                          url: '/test/file-upload.php',
                          waitMsg: 'Сохранение фотографии...',
                          success: function(loadfile, o){
                              msg('Success', 'Processed file "'+o.result.file+'" on the server');
                          }
                      });
              }
          }
      },{
          text: 'Сброс',
          handler: function(){
              loadfile.getForm().reset();
               }
            }]
         });
  </code></pre>
  
  <p>file-upload.php: </p>
  
  <pre><code> $uploaddir = '/var/lib/tomcat6/webapps/test/upload/000'//.$_GET["path"];
   if (!is_dir($uploaddir))
    {
      mkdir($uploaddir, 0777);
    }
   $uploaddir.='/';
   if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .
       $_FILES['userfile']['name'])) {
   echo $uploaddir;
   } else {
   echo "error";
  }
  </code></pre>
  
  <p>and i have error in ext-all.js: </p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected token &lt;</p>
  </blockquote>