Read a file data using file browser in Jom social (Joomla ) using PHP
It is bit typical to add own php code to take a file into the system using a file browser.
Here below I have attached the code
---------------------------------------------------------------------------
jimport('joomla.filesystem.file');
$jinput = JFactory::getApplication()->input;
$fileInput = new JInput($_FILES);
$file = $fileInput->get('thumb', null, 'array');
if(isset($file) && !empty($file['name'])) {
$filename = JFile::makeSafe($file['name']);
$src = $file['tmp_name'];
$data['image']=$filename;
}
--------------------------------------------------------------------------------
Below I have attached the client code below.
Here below I have attached the code
---------------------------------------------------------------------------
jimport('joomla.filesystem.file');
$jinput = JFactory::getApplication()->input;
$fileInput = new JInput($_FILES);
$file = $fileInput->get('thumb', null, 'array');
if(isset($file) && !empty($file['name'])) {
$filename = JFile::makeSafe($file['name']);
$src = $file['tmp_name'];
$data['image']=$filename;
}
--------------------------------------------------------------------------------
Below I have attached the client code below.
<div class="fileUpload btn btn-primary">
<span>Upload</span>
<input id="thumb" class="upload" type="file" style="position:
absolute; top: 0; right: 0; margin: 0; padding: 0; font-size: 20px;
cursor: pointer;opacity: 0;filter: alpha(opacity=0); width:150px;" name="thumb">
</div>
Comments
Post a Comment