Sitelet https://github.com/xezzus/fileupload
Skip to content

About

Multiple file upload plugin with progress-bar, drag-and-drop.

Resources

Stars

3 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

90 Commits

Folders and files

Repository files navigation

This plugin uses Jquery for uploading files in FF3.6+, Safari4+.

Features

  • does not use a flash

Development plan

  • multiple file select, progress-bar all Browser

Known Issues

Button input file use the top html doc, script use bottom HTML doc. Not use script all body space HTML doc.

Install

  <script src="/sitelet?url=https%3A%2F%2Fgithub.com%2Fxezzus%2Fjquery.min.js" type="text/javascript"></script>
  <script src="/sitelet?url=https%3A%2F%2Fgithub.com%2Fxezzus%2Fjquery.fileupload.js" type="text/javascript"></script>

You can then use the plugin.

  <script>
    $('input[type=file]').fileupload({
      url:"/ajax.php",
      success:function(dat){
        if(dat.status == 'ok') { alert(dat.file); }
      },
      dataType:'json'
    });
  </script>
  </body>
  • url - address of the handler to accept the file
  • success - gets a response from the handler and performs actions additionally
  • dataType - can return the results in various formats "json" and "txt"

File ajax.php

  <?php
    require_once('fileupload.php');
    $dir = '/upload/';
    $file fileupload($dir);
    echo json_encode(array('status'=>'ok','file'=>$file));
  ?>

About

Multiple file upload plugin with progress-bar, drag-and-drop.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages