This is the support topic for Jumploader - Java Uploader
This is the support topic for Jumploader - Java Uploader
Hi, the extension looks great, however Im having some trouble when using it with CSRF validation, is there a way I can send this token with the upload request? thanks.
Just pass in attributes…
For more information read
Just add another attribute with the CSRF token name and value.
I’ve this problem: the widget doesn’t show anything!
I’ve put this in the configuration file as written in the documentation:
'jumploader' => array( 'class' => 'ext.jumploader.jumploader', ),
in my view files i put this code:
'uploadUrlAction' => $this->createUrl('controllerID/actionID'), // The uploader action that will handle the uploaded files, each file will send a request to this action 'uploadDirectory' => Yii::getPathOfAlias('webroot.uploads'), // The uploaded directory, Basically this is only relevant if you use the Yii::app()->jumploader->uploadFiles() method that serves as a simple uploading method. 'width'=>900, // sets the applet width 'allowedExtensions' => array( 'jpg', 'jpeg', 'gif', 'png' ), // array of allowed extensions to upload (without the prefix dot ( . ) ) 'height'=>600, // sets the applet height 'debugMode' => 'DEBUG', // enable debug allowed options are 'INFO', 'DEBUG', 'WARN', 'ERROR', 'FATAL', You can views those logs in the Java console. Defaults to false. 'language' => 'fr', // Set the applet language, Currently there is a limited number of supported languages, Check the 'application/extensions/jumploader/jlassets/messages/ directory for the list of available languages. 'maxFiles' => 5, // Number of maximum allowed files to upload. If the member refreshes the page this will be reset even if he previously uploaded. defaults to '-1' which means unlimited. 'maxFileSize' => '17KB', // string that represents the maximum size of a single file uploaded, Examples: '10MB', '1024KB', '2GB' etc. Defaults to '-1' which means unlimited. 'maxUploadSize' => '33KB', // string that represents the maximum size of total files uploaded, Examples: '10MB', '1024KB', '2GB' etc. Defaults to '-1' which means unlimited. ));
but the page is blank even though the html code show me something…
name="jumpLoaderApplet" code="jmaster.jumploader.app.JumpLoaderApplet.class" archive="/assets/99a97516/jumploader_z.jar" width="900" height="600" mayscript> <param name="uc_fileNamePattern" value="^.+\.(?i)((jpg)|(jpeg)|(gif)|(png))$"/> <param name="vc_fileNamePattern" value="^.+\.(?i)((jpg)|(jpeg)|(gif)|(png))$"/> <param name="uc_maxFiles" value="5"/> <param name="uc_maxFileLength" value="17408"/> <param name="uc_maxLength" value="33792"/> <param name="uc_uploadUrl" value="/controllerID/actionID"/> <param name="ac_messagesZipUrl" value="/assets/99a97516/messages/messages_fr.zip"/> <param name="gc_loggingLevel" value="DEBUG"/> <param name="vc_disableLocalFileSystem" value="false"/> <param name="vc_mainViewFileTreeViewVisible" value="true"/> <param name="vc_mainViewFileListViewVisible" value="true"/> <param name="vc_lookAndFeel" value="system"/>
</div><!-- content -->
Where’s the mistake?
It seems like the $uploadDirectory variable cannot be set in the configuration.I have to dig in the uploadFiles() method in jumploader.php to specify the upload directory in the move_uploaded_file() argument.Weird.Anybody else has experienced that?
Need to fix extensions/jumploader/views/jumploader.php, on line 76:
Yii::app()->jumploader->appletOptions = Yii::app()->jumploader->appletOptions + Yii::app()->jumploader->defaultAppletOptions;
In the other way $arrayOptions is always overwritten by $defaultArrayOptions
For CSRF token support:
Your applet configuration should look like this (in the same view):
$this->widget('ext.jumploader.jumploaderwidget', array( 'uploadUrlAction' => '/admin/offer/upload', 'width' => 690, 'height' => 600, 'appletOptions' => array( 'vc_mainViewFileTreeViewVisible' => false, 'vc_mainViewFileListViewVisible' => false, 'vc_lookAndFeel' => 'system', 'ac_fireAppletInitialized' => true, ), ));
The important line here is “‘ac_fireAppletInitialized’ => true,”. It runs the appletInitialized() function just after the applet is completely loaded.
You can also add as many parameters as you want calling addJumpLoaderAttr() from appletInitialized(). Those parameters are sended, as the JumpLoader documentation says, in $_POST.
First of all, excellent extension! I’m switching from my old sfancyupload to it right now!
I’ve just translated the messages to Portuguese (Brazil)
If somebody wants the file, it follows attached!
Thanks and regards
tks! confirmed! i’ve tried in appletOptions
'vc_mainViewFileListViewVisible' => false,
and it only worked after @chirvo’s tip
Not sure if this is the correct forum to ask, so apologies if this should have been posted elsewhere.
I’ve been looking into extensions that will enable my users to upload multiple pictures. I’ve managed to setup this extension pretty straightforward, and it all works beautifully using an upload action that uses Yii::app()->jumploader->uploadFiles(). Now, here is the scenario that I have some trouble with…
All the uploaded files need to be processed after uploading, and each the url of each file associated with a user by recording it in a database. As far as I can tell, it means that if a user uploads 30 pictures, it is similar to 30 times submitting a form with one upload field. Obviously, I don’t want to query the database 30 times with individual insert statements.
How would I go about this? I could store an accumulated array of file objects in session and process them once the uploads are done. But is there a way for this extension / Jumploader to signal to the server that it is done? Is there a better way in the first place?
“normally”, when you use an uploader to upload multiple files, you’d get an array of uploaded files.
You can use that to perform actions on them, like storing them in the db, etc.
At least that’s what the Uploadify Yii extension does IIRC.
That was actually what I was expecting, but as far as I can tell this extension processes them one (POST request) at a time. I’m not ruling out I’m missing something obvious here though, I just haven’t found it yet.