[EXTENSION] FancyUpload

Scoob you are a Guru in this!! Thanks

Hey Scoob,

thanks for this great extension. Is there a way to have a progressbar with the SFancySingleButton? I only see a progress bar if I use “SFancyQueue”, but I don’t want to allow multiple uploads.

Hey, bitmatix,

I’m not sure because the default behavior for the single upload is to show the progress in XX%, but it would be nice to have a little progress bar.

Maybe in the official forum someone has already done something like this, I’ll check and post here if i found an answer.

:)

Regards

Hey Scoob,

thanks for the reply, but the single upload doesn’t show me any XX% :frowning:

Regards

well, its a bit weird, usually it works in Windows environment only due to bugs in Flash for Linux, also if the file is too small I think that there is no time for flash update percentage

anyway, please, try the new version 1.3 in the extension page

regards!!

:)

GOOD JOB…

think you

Hi! first of all - thx for great extension!

and now the problem :))

i’ve problem with csrf check. here is config




                'appendCookieData'=>true,

                'data'=>array(

                    'publication'=>$post->id,

                    'YII_CSRF_TOKEN'=>Yii::app()->request->csrfToken

                ),



and here is controller




    public function actionUploadedFiles()

    {

        session_id($_POST['PHPSESSID']);

        session_start();


        $file = CUploadedFile::getInstanceByName("Filedata");

        $logFile = Yii::app()->getBasePath() . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . 'mylog.txt';

        $result = array();

        $result['time'] = date('r');

        $result['temp'] = $file->getTempName();

        $result['name'] = $file->getName();

        ....................



well, the problem is that the session is not restored, and CHttpRequest could not get cookie YII_CSRF_TOKEN value.

what do i wrong? accessFilter is on. i’ve php version 5.3.2

please, try disabling accessFilter and logging the values with

    $result['token'] = CHttpRequest::getParam('YII_CSRF_TOKEN');


    $result['PHPSESS'] = CHttpRequest::getParam('PHPSESSID');

please, let us know if it is logged right

regards

when i disable accessFilter - csrf error doesn’t gone… if i disable csrf and accessFilter - only token is logged< no phpsessid…

UPDATE

i get this data logged!

the token value is the same as the script sends. but phpsessid is another.

Hello i’m trying to use this extension on windows vista, i use the last Yii version. Someone can explain me detailed how can i put multiple upload files working just with the needed code (easy and clean). I’m new to yii. Thanks.

i’m sorry for delay in replying this…have not figured out what happens in this case…that’s a weird issue

what if you pass PHPSESSID through the "data" option of the widget?

regards!!

When i use this extension i get HTTP-Status #500 error, but i only could see this because i take printscreens… because the error is cleaned after the "upload". can you help me scoob

This are my files: FancyController under protected/controllers

and fancyqueue.php under views/fancy

and i have a protected/tmp directory

hey! thanks for trying this

first, be sure your /protected/tmp directory has everyone full control under windows or chmod 777 in linux, due to eliminate this possibility

after, the last headache I’ve had with the error 500 whas that my PHP instalation had a bug…finfo_open function couldn’t find the magic database file to determine the mimetype so the mimeType always was returned as empty

lets try something:

in your controller, action UploadedFiles, try using getMimeTypeByExtension instead of getMimeType, like




$mime = CFileHelper::getMimeTypeByExtension($file->getName());



I’ve suggested to Qiang to add the second parameter in getMimeTypeByExtension like PHP finfo_open function accepts, to point to the path of magic database file and he has already done this in SVN

please, let me know if it solves the problem

regards!!

:)

Thanks it solved my problem… much thanks :)

anytime

be wise that geMimeTypeByExtension() is not the best way to determine the real type of a file because one could simply upload an exe file just renaming it from somefile.exe to somefile.jpg, so, the best way to solve is to get the newest version of Yii (SVN) or at least the CFileHelper class from there and change back to getMimeType()

:)

regards!!

Ok thank you.

By the way is that normal that the error messages are cleaned automatically? Because i only could see that http-500 error by doing a lot of printscreens… because the program backs to normal like no error hapenned.

You can see a sequence of the process:

727

print1.png

it is done via javascript, take a look at the callbacks in the view file, like ‘onComplete’, ‘onFileComplete’ or something like this. One of them contains a code like location.reload() or location.refresh(), just comment it out

:)

regards!

Ok thanks, but all my files give me an error: Erro no envio: ({"status":"1","name":"20051210-w50s.flv"}

all similar errors… but the files are uploaded to my directory tmp.

730

error.png

What i’m doing wrong?

thanks for your support scoob. best regards.

BTW using framework/utils/CFileHelper.php from the SVN dind’t solve my problem with the getMimeType() problem so im still using the getMimeTypeByExtension().

best regards