Update LanguageController
Updated for public and non public directory structure of system.
This commit is contained in:
@@ -170,8 +170,8 @@ class LanguageController extends Controller
|
|||||||
// checking file is valid.
|
// checking file is valid.
|
||||||
if (Input::file('File')->isValid()) {
|
if (Input::file('File')->isValid()) {
|
||||||
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
|
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||||
$destinationPath = '../public/uploads/'; // defining uploading path
|
$destinationPath = base_path('public/uploads/'); // defining uploading path
|
||||||
$extractpath = '../resources/lang/'.strtolower(Input::get('iso-code')); //defining extracting path
|
$extractpath = base_path('resources/lang').'/'.strtolower(Input::get('iso-code')); //defining extracting path
|
||||||
mkdir($extractpath); //creating directroy for extracting uploadd file
|
mkdir($extractpath); //creating directroy for extracting uploadd file
|
||||||
//mkdir($destinationPath);
|
//mkdir($destinationPath);
|
||||||
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
||||||
@@ -212,8 +212,8 @@ class LanguageController extends Controller
|
|||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function download()
|
public function download()
|
||||||
{
|
{ $file_path = base_path('public/downloads/en.zip');
|
||||||
return response()->download('../public/downloads/en.zip');
|
return response()->download($file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -226,7 +226,7 @@ class LanguageController extends Controller
|
|||||||
public function deleteLanguage($lang)
|
public function deleteLanguage($lang)
|
||||||
{
|
{
|
||||||
if ($lang !== App::getLocale()) {
|
if ($lang !== App::getLocale()) {
|
||||||
$deletePath = base_path('resources/lang').$lang; //define file path to delete
|
$deletePath = base_path('resources/lang').'/'.$lang; //define file path to delete
|
||||||
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
||||||
if ($success) {
|
if ($success) {
|
||||||
//sending back with success message
|
//sending back with success message
|
||||||
|
Reference in New Issue
Block a user