Cjax Framework


Upload files with Flash and Cjax, by using Uploadify - completely in PHP!
PHP
<?php 


    
//Paths are relative to uploadify plugin directory.
    
$uploadify $ajax->uploadify('.upload', array(
    
'height' => 22,
    
'checkExisting' => true//or false
    
'fileTypeDesc' => 'Images Files',
    
'fileTypeExts' => '*.jpg;*.png;*.gif',
    
'onUploadStart' => "function() {
    uploadify.loading('Uploading file...');
    }"
,
    
'onUploadProgress' => "function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {
    uploadify.loading(totalBytesUploaded + ' bytes uploaded of ' + totalBytesTotal + ' bytes.');
    }"
,
    
'onUploadSuccess' => "function(file, data, response) {
    uploadify.success('The file ' + file.name + ' was successfully uploaded.');
    }"
,
    
'onUploadError' => "function() {
    uploadify.warning('An error occurred!');
    }"
,
    
'onError' => "function() {
    uploadify.error('An error occurred!');
    }"
    
));


    
//Example of overwritting options, you may overwrite any available options
    
$uploadify->fileTypeDesc 'Media Files';
    
//Update extensions supported to upload
    
$uploadify->fileTypeExts '*.pdf;*.docx;*.doc;*.jpg;*.png;*.gif;*.zip';

    
//UPLOAD DIRECTORY
    //if you remove this line, it will  be by default uploaded to the plugin uploads/ directory . (if writable)
    
$uploadify->target $_SERVER['DOCUMENT_ROOT'];
    
//replace the above line to the directory where you want the uploads to go

    
?>

Upload..

Submit Form

Upload files through uploadify plugin...




This Plugins uses Jquery and Jquery.uploadify plugin to upload files through flash and CJAX Api.
All methods available in uploadify are also available here, you may change these settings.

Previous Topic:  Previous Class    ·   Top of Page   ·   Demos Home   ·  

CodeIgniter  ·  Copyright © 2006 - 2012  ·  Cjax