views:

389

answers:

1

There is issue, when Uploadify plugin desn't POST more than 1 parameter.
Tried 3 variants below.
Any suggestions or experince?

First - standard way
explanation: portletId and jsessionid params passed in 'script' :

oScript.text = "var $j = jQuery.noConflict();";
oScript.text+= "$j(document).ready(function(){";
...
oScript.text+= "$j('#uploadify').uploadify({";
oScript.text+= "'script'   : '<%= request.getContextPath()%>/uploadFile?portletId=${portletId}&jsessionid=${pageContext.session.id}',"; 
...

Second - with 'scriptData'
explanation: portletId remained, jsessionid moved to 'scriptData':

oScript.text = "var $j = jQuery.noConflict();";
oScript.text+= "$j(document).ready(function(){";
...
oScript.text+= "$j('#uploadify').uploadify({";
oScript.text+= "'script'   : '<%= request.getContextPath()%>/uploadFile?portletId=${portletId}',"; 
oScript.text+= "'scriptData' : {'jsessionid':'${pageContext.session.id}'},";
...

Third - with events onSelect and onOpen
(tried both,descriped in http://stackoverflow.com/questions/1970558/problem-sending-additional-post-data-to-server-with-uploadify)
explanation: portletId remained and jsessionid is set on event (onSelect or onOpen):

oScript.text = "var $j = jQuery.noConflict();";
oScript.text+= "$j(document).ready(function(){";
...
oScript.text+= "$j('#uploadify').uploadify({";
oScript.text+= "'script'   : '<%= request.getContextPath()%>/uploadFile?portletId=${portletId}',"; 

oScript.text+= "'onOpen' : function(){";
oScript.text+= "$j('#uploadify').uploadifySettings(";
oScript.text+= "'scriptData', {'jsessionid':'${pageContext.session.id}'});}";
...
A: 

Finally resolved. You should use 'GET' value as 'method' param mandatory. And 'scriptData' correspondingly.

see details here: uploadify forum post

sergionni