I developing one gallery-component in joomla2.5 using uplodify
I have used the following code in view of my_component
$session = & JFactory::getSession();
$document = &JFactory::getDocument();
$document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');
$document->addScript(JURI::root(true).'/administrator/components/com_mycomponent/uplodify/jquery.uploadify-3.1.min.js');
$document->addStyleSheet(JURI::root(true).'/administrator/components/com_mycomponent/uplodify/uploadify.css');
$UploadHeadJs ='
// <![CDATA[
jQuery.noConflict();
jQuery(function() {
console.log("load");
jQuery("#model_upload").uploadify({
"swf" : "'.JURI::root(true).'/administrator/components/com_mycomponent/uplodify/uploadify.swf",
"uploader" : "index.php",
"formData" : {"option" : "com_mycomponent", "controller" : "uploadify","task":"uploadify.upload","'.$session->getName().'" : "'.$session->getId().'","cid":"'.$item->id.'","tmpl":"component"},
"method" : "post",
"cancelImg" : "'.JURI::root(true).'/administrator/components/com_mycomponent/uplodify/uploadify-cancel.png",
"uploadLimit" : 25,
"auto" : true,
"buttonText" : "SELECT MODEL",
"debug" : true,
"fileObjName" : "modelImage",
"fileSizeLimit" : "'.ini_get('upload_max_filesize').'B",
"fileTypeDesc" : "Only 25 pictures allow(.jpeg,.gif)",
"fileTypeExts" : "*.jpeg;*.jpg;*.JPEG;*.JPG;*.GIF;*.gif;*.png;*.PNG",
"multi" : true,
"queueID" : "queue",
"height" : 22,
"onUploadError" : function(file, errorCode, errorMsg, errorString) {
console.log( errorMsg);
},
"onUploadSuccess" : function(file, data, response) {
console.log(response);
}
// Put your options here
});
});
//]]>';
$document->addScriptDeclaration($UploadHeadJs);
In default.php contain the following code
<input type="file" name="modelUpload" id="model_upload"/>
<div id="upload-queue-s" style="background:#CCCCCC">
<div class="inQueu" id="queue"></div>
<ul class="fileQueu">
</ul>
</div>
Uplodfiy is loading properly , now when i start the coding into controller and just try to echo something to confirm that requested url is working fine or not and it will redirect me the login page of administrator of joomla
so my issue is that why it redirect me the login page , is there issue with session ?? how can i get request form uplodify to joomla controller file ??