Yii Framework Forum: [EXTENSION] Java Uploader Extension - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] Java Uploader Extension Rate Topic: -----

#1 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 27 April 2010 - 07:01 AM

This is the support topic for Jumploader - Java Uploader
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#2 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 25 May 2010 - 11:04 AM

View PostVince., on 27 April 2010 - 07:01 AM, said:

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.
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#3 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 25 May 2010 - 02:04 PM

Just pass in attributes...

For more information read

http://www.jumploade...attributes.html

Just add another attribute with the CSRF token name and value.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#4 User is offline   Asgaroth 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 17-July 09
  • Location:Bogota, Colombia

Posted 25 May 2010 - 02:45 PM

Thanks for the reply, however I was looking for a way of doing this without javascript, but reading through the jumploader forums I found that this is not currently supported.
- Extension: Dynamic DataProvider Behavior
- Extension: XUpload - jQuery File Upload Extension
- Extension: PhpQuickProfiler - A Web Log Router that will help you profile your application
- Extension: XDateView - A Date grouped Grid View
- Extension: Foundation - An easy to use, powerful, and flexible framework for building prototypes and production code on any kind of device.



- Wiki: How to generate Yii like Documentation
- Wiki: How to re enable logging during unit testing
0

#5 User is offline   daniele 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 04-June 10

Posted 13 October 2010 - 05:03 PM

hi!

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:

<?php
$this->widget('ext.jumploader.jumploaderwidget', array(
'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...


<div id="content">
<br />

<applet
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"/>


</applet>
</div><!-- content -->

Where's the mistake?
0

#6 User is offline   drumaddict 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 04-October 10
  • Location:Athens,Greece

Posted 27 October 2010 - 06:12 PM

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?
0

#7 User is offline   chirvo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 30-November 10
  • Location:Venezuela

Posted 20 April 2011 - 09:06 AM

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
1

#8 User is offline   chirvo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 30-November 10
  • Location:Venezuela

Posted 20 April 2011 - 09:14 AM

For CSRF token support:

In your view, add this Javascript code:

<script type="text/javascript">
	function addJumpLoaderAttr(name, value) {
		var uploader = document.jumpLoaderApplet.getUploader();
		var attrSet = uploader.getAttributeSet();
		var attr = attrSet.createStringAttribute(name, value);
		attr.setSendToServer(true);
	}

	function appletInitialized(applet) {
		var name = "<?php echo Yii::app()->request->csrfTokenName; ?>";
		var value = "<?php echo Yii::app()->request->csrfToken; ?>";
		addJumpLoaderAttr(name, value);
	}
</script>


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.
0

#9 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 415
  • Joined: 24-May 09
  • Location:Brazil

Posted 21 April 2011 - 02:32 PM

Hey, guys!

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

Attached File  messages_br.zip (2.41K)
Number of downloads: 6
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
0

#10 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 415
  • Joined: 24-May 09
  • Location:Brazil

Posted 21 April 2011 - 07:57 PM

View Postchirvo, on 20 April 2011 - 09:06 AM, said:

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



tks! confirmed! i've tried in appletOptions
'vc_mainViewFileListViewVisible' => false,


and it only worked after @chirvo's tip

regards!
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
0

#11 User is offline   jodev 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 10-January 11
  • Location:The Netherlands

Posted 14 September 2011 - 03:41 PM

Hi,

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?

Thanks!
0

#12 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 14 September 2011 - 04:30 PM

"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.
"Less noise - more signal"
0

#13 User is offline   jodev 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 10-January 11
  • Location:The Netherlands

Posted 18 September 2011 - 02:56 AM

View Postjacmoe, on 14 September 2011 - 04:30 PM, said:

"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.


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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users