Login   Register  
PHP Classes
elePHPant
Icontem

File: qquploaderRecv.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jakub Krol  >  Glowfoto API  >  qquploaderRecv.php  >  Download  
File: qquploaderRecv.php
Role: Example script
Content type: text/plain
Description: Example handler for qquploader upload script
Class: Glowfoto API
Upload images to Glowfoto using its API
Author: By
Last change:
Date: 2012-10-01 09:39
Size: 753 bytes
 

Contents

Class file image Download
<?php
    
//This is example of qquploader files handler - it will handle upload and return results to qquploader.

    
include_once('glowFoto.class.php');
    
$glowFoto = new GlowFotoAPI();
    
$glowFoto->setThumbSize(GlowFotoAPI::THUMB_SIZE_100);
    if (isset(
$_GET['qqfile'])) {                
        
$URLs=$glowFoto->fastSendFromPOSTOrFileContent(file_get_contents('php://input'));
    } elseif (isset(
$_FILES['qqfile'])) {
        
$URLs=$glowFoto->fastSendFromFile($_FILES['qqfile']['tmp_name']);
        
unlink($_FILES['qqfile']['tmp_name']);
    } else die(
'error');
    
$ar = array('success'=>true'thumbUrl'=>(string)$URLs['thumb'], 'imgUrl'=>(string)$URLs['img']);
    echo 
htmlspecialchars(json_encode($ar), ENT_NOQUOTES);
?>