<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Recupera username jquery upload]]></title><description><![CDATA[<p dir="auto">Salve a tutti, non so se il posto giusto per un problema con <strong>Jquery File Upload</strong> e <strong>Joomla 3</strong> ...ma provo.</p>
<p dir="auto">Vorrei come accennavo a recuperare la sessione di joomla nel file (classe) <strong>UploadHandler.php</strong> di Jquery File Upload che<br />
provando e riprovando con il classico:</p>
<pre><code class="language-php">define( '_JEXEC', 1 ); define( '_VALID_MOS', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/' ) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); 
$mainframe =&amp; JFactory::getApplication('site');
$mainframe-&gt;initialise();  
$user =&amp; JFactory::getUser();
$user-&gt;username;
</code></pre>
<p dir="auto">ma ricevo errore...come fare...qualcuno di voi a risolto questo problema?</p>
<p dir="auto">un accenno del file <strong>UploadHandler.php</strong></p>
<pre><code class="language-php">class UploadHandler
{

    protected $options;


    protected $error_messages = array(
        1 =&gt; 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
        2 =&gt; 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
        3 =&gt; 'The uploaded file was only partially uploaded',
        4 =&gt; 'No file was uploaded',
        6 =&gt; 'Missing a temporary folder',
        7 =&gt; 'Failed to write file to disk',
        8 =&gt; 'A PHP extension stopped the file upload',
        'post_max_size' =&gt; 'The uploaded file exceeds the post_max_size directive in php.ini',
        'max_file_size' =&gt; 'File is too big',
        'min_file_size' =&gt; 'File is too small',
        'accept_file_types' =&gt; 'Filetype not allowed',
        'max_number_of_files' =&gt; 'Maximum number of files exceeded',
        'max_width' =&gt; 'Image exceeds maximum width',
        'min_width' =&gt; 'Image requires a minimum width',
        'max_height' =&gt; 'Image exceeds maximum height',
        'min_height' =&gt; 'Image requires a minimum height',
        'abort' =&gt; 'File upload aborted',
        'image_resize' =&gt; 'Failed to resize image'
    );

    protected $image_objects = array();

    function __construct($options = null, $initialize = true, $error_messages = null) {
        $this-&gt;options = array(
            'script_url' =&gt; $this-&gt;get_full_url().'/',
            'upload_dir' =&gt; dirname($this-&gt;get_server_var('SCRIPT_FILENAME')).'/files/',
            'upload_url' =&gt; $this-&gt;get_full_url().'/files/',
            'user_dirs' =&gt; false,
            'mkdir_mode' =&gt; 0755,
            'param_name' =&gt; 'files',
            // Set the following option to 'POST', if your server does not support
            // DELETE requests. This is a parameter sent to the client:
            'delete_type' =&gt; 'DELETE',
            'access_control_allow_origin' =&gt; '*',
            'access_control_allow_credentials' =&gt; false,
            'access_control_allow_methods' =&gt; array(
                'OPTIONS',
                'HEAD',
                'GET',
                'POST',
                'PUT',
                'PATCH',
                'DELETE'
            ),
            'access_control_allow_headers' =&gt; array(
                'Content-Type',
                'Content-Range',
                'Content-Disposition'
            ),
            // Enable to provide file downloads via GET requests to the PHP script:
            //     1. Set to 1 to download files via readfile method through PHP
            //     2. Set to 2 to send a X-Sendfile header for lighttpd/Apache
            //     3. Set to 3 to send a X-Accel-Redirect header for nginx
            // If set to 2 or 3, adjust the upload_url option to the base path of
            // the redirect parameter, e.g. '/files/'.
            'download_via_php' =&gt; false,
            // Read files in chunks to avoid memory limits when download_via_php
            // is enabled, set to 0 to disable chunked reading of files:
            'readfile_chunk_size' =&gt; 10 * 1024 * 1024, // 10 MiB
            // Defines which files can be displayed inline when downloaded:
            'inline_file_types' =&gt; '/\.(gif|jpe?g|png)$/i',
            // Defines which files (based on their names) are accepted for upload:
            'accept_file_types' =&gt; '/.+$/i',
            // The php.ini settings upload_max_filesize and post_max_size
            // take precedence over the following max_file_size setting:
            'max_file_size' =&gt; null,
            'min_file_size' =&gt; 1,
            // The maximum number of files for the upload directory:
            'max_number_of_files' =&gt; null,
            // Defines which files are handled as image files:
            'image_file_types' =&gt; '/\.(gif|jpe?g|png)$/i',
            // Use exif_imagetype on all files to correct file extensions:
            'correct_image_extensions' =&gt; false,
            // Image resolution restrictions:
            'max_width' =&gt; null,
            'max_height' =&gt; null,
            'min_width' =&gt; 1,
            'min_height' =&gt; 1,
            // Set the following option to false to enable resumable uploads:
            'discard_aborted_uploads' =&gt; true,
            // Set to 0 to use the GD library to scale and orient images,
            // set to 1 to use imagick (if installed, falls back to GD),
            // set to 2 to use the ImageMagick convert binary directly:
            'image_library' =&gt; 1,
            // Uncomment the following to define an array of resource limits
            // for imagick:
            /*
            'imagick_resource_limits' =&gt; array(
                imagick::RESOURCETYPE_MAP =&gt; 32,
                imagick::RESOURCETYPE_MEMORY =&gt; 32
            ),
            */
            // Command or path for to the ImageMagick convert binary:
            'convert_bin' =&gt; 'convert',
            // Uncomment the following to add parameters in front of each
            // ImageMagick convert call (the limit constraints seem only
            // to have an effect if put in front):
            /*
            'convert_params' =&gt; '-limit memory 32MiB -limit map 32MiB',
            */
            // Command or path for to the ImageMagick identify binary:
            'identify_bin' =&gt; 'identify',
            'image_versions' =&gt; array(
                // The empty image version key defines options for the original image:
                '' =&gt; array(
                    // Automatically rotate images based on EXIF meta data:
                    'auto_orient' =&gt; true
                ),
                // Uncomment the following to create medium sized images:
                /*
                'medium' =&gt; array(
                    'max_width' =&gt; 800,
                    'max_height' =&gt; 600
                ),
                */
                'thumbnail' =&gt; array(
                    // Uncomment the following to use a defined directory for the thumbnails
                    // instead of a subdirectory based on the version identifier.
                    // Make sure that this directory doesn't allow execution of files if you
                    // don't pose any restrictions on the type of uploaded files, e.g. by
                    // copying the .htaccess file from the files directory for Apache:
                    //'upload_dir' =&gt; dirname($this-&gt;get_server_var('SCRIPT_FILENAME')).'/thumb/',
                    //'upload_url' =&gt; $this-&gt;get_full_url().'/thumb/',
                    // Uncomment the following to force the max
                    // dimensions and e.g. create square thumbnails:
                    //'crop' =&gt; true,
                    'max_width' =&gt; 80,
                    'max_height' =&gt; 80
                )
            )
        );
        if ($options) {
            $this-&gt;options = $options + $this-&gt;options;
        }
        if ($error_messages) {
            $this-&gt;error_messages = $error_messages + $this-&gt;error_messages;
        }
        if ($initialize) {
            $this-&gt;initialize();
        }
    }

    protected function initialize() {
        switch ($this-&gt;get_server_var('REQUEST_METHOD')) {
            case 'OPTIONS':
            case 'HEAD':
                $this-&gt;head();
                break;
            case 'GET':
                $this-&gt;get();
                break;
            case 'PATCH':
            case 'PUT':
            case 'POST':
                $this-&gt;post();
                break;
            case 'DELETE':
                $this-&gt;delete();
                break;
            default:
                $this-&gt;header('HTTP/1.1 405 Method Not Allowed');
        }
    }
</code></pre>
<p dir="auto">Grazie, un salutone a tutti!</p>
]]></description><link>https://dev.connect.gt/topic/207752/recupera-username-jquery-upload</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 19:41:18 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/207752.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Nov 2014 14:59:51 GMT</pubDate><ttl>60</ttl></channel></rss>