SWFUpload

Derek Jones edited this page Jul 5, 2012 · 19 revisions
Clone this wiki locally

Category:Libraries::External | Category:Libraries::Tranfsers

SWFUpload with CI 1.5x.

SWFUpload is a small JavaScript/Flash library to get the best of both worlds. It features the great upload capabilities of Flash and the accessibility and ease of HTML/CSS. See it in action.

  • Upload multiple files at once by ctrl/shift-selecting in dialog
  • Javascript callbacks on all events
  • Get file information before upload starts
  • Style upload elements with XHTML and css
  • Display information while files are uploading using HTML
  • No page reloads necessary
  • Works on all platforms/browsers that has Flash support.
  • Degrades gracefully to normal HTML upload form if Flash or javascript is unavailable
  • Control filesize before upload starts
  • Only display chosen filetypes in dialog
  • Queue uploads, remove/add files before starting upload

Usage

In your view file, include the SWFUpload javascript file:

<script type="text/javascript" src="jscripts/SWFUpload/mmSWFUpload.js"></script>

In your controller, pass "Filedata" as the name value for the do_upload function:

$this->upload->do_upload('Filedata')

In your mimes.php file, add 'application/octet-stream' for all allowed image formats

'gif'    =>    array('image/gif', 'application/octet-stream'),
'jpeg'    =>    array('image/jpeg', 'image/pjpeg', 'application/octet-stream'),
'jpg'    =>    array('image/jpeg', 'image/pjpeg', 'application/octet-stream'),
'jpe'    =>    array('image/jpeg', 'image/pjpeg', 'application/octet-stream'),
'png'    =>    array('image/png',  'image/x-png', 'application/octet-stream'),

That's it!

  • Slith The Seventh Letter / Iron Eye