I have created a upload modal field to upload content into the images directory and it all works perfectly fine, except the redirect after the upload.
This is the upload Form in the modal window:
<form action="<?php echo JUri::base(); ?>index.php?option=com_file_manager&task=file.upload&tmpl=component&<?php echo $this->session->getName() . '=' . $this->session->getId(); ?>&<?php echo JSession::getFormToken();?>=1&view=file" id="uploadForm" class="form-horizontal" name="uploadForm" method="post" enctype="multipart/form-data">
<div id="uploadform" class="well">
<fieldset id="upload-noflash" class="actions">
<div class="control-group">
<div class="control-label">
<label for="upload-file" class="control-label"><?php echo JText::_('COM_MEDIA_UPLOAD_FILE'); ?></label>
</div>
<div class="controls">
<input type="file" id="upload-file" name="Filedata[]" multiple /><button class="btn btn-primary" id="upload-submit"><i class="icon-upload icon-white"></i> <?php echo JText::_('COM_MEDIA_START_UPLOAD'); ?></button>
</div>
</div>
</fieldset>
<input type="hidden" name="return-url" value="<?php echo base64_encode('index.php?option=com_fal_manager&view=file&layout=modal&tmpl=component'); ?>" />
</div>
</form>
And this is how the redirect looks in the controller:
public function upload() {
// Check for request forgeries
JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));
$files = $this->input->files->get('Filedata', '', 'array');
$return = $this->input->post->get('return-url', null, 'base64');
$this->folder = $this->input->get('folder', '', 'path');
if ($return) {
$this->setRedirect(base64_decode($return));
}
}
I just need it to take me back to the original place i was before i uploaded it, the url of the modal is:
index.php?option=com_file_manager&view=videofile&layout=modal&tmpl=component&function=jSelectVideofile_jform_video
and after upload:
index.php?option=com_file_manager&view=videofile&layout=modal&tmpl=component&function=jSelectVideofile_jform_video
Weird I know, its the same url, but its not the same page.. It takes me to the list view of that page.
Any Help Greatly Appreciated