Skip to content

Commit

Permalink
Adiciona tenant ao upload de arquivos
Browse files Browse the repository at this point in the history
  • Loading branch information
edersoares committed Jul 4, 2019
1 parent 32fe4cd commit 5e71187
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions ieducar/intranet/file_check.php
Expand Up @@ -60,9 +60,11 @@ function __construct($file, $maxSize = NULL,
function sendFile(){
$tmp = $this->file["tmp_name"];

$tenant = config('legacy.app.database.dbname');

$file = new File($tmp);
if (Storage::put('/', $file)) {
$filePath= Storage::url($file->hashName());
$filePath= Storage::url($file->hashName($tenant));
return $filePath;
} else {
$this->errorMessage = "Ocorreu um erro no servidor ao enviar foto. Tente novamente.";
Expand Down Expand Up @@ -123,4 +125,4 @@ function getExtension($name)
}
}

?>
?>
7 changes: 5 additions & 2 deletions ieducar/intranet/file_check_just_pdf.php
Expand Up @@ -58,9 +58,12 @@ function __construct($file, $maxSize = NULL,
function sendFile(){
$tmp = $this->file["tmp_name"];

$tenant = config('legacy.app.database.dbname');

$file = new File($tmp);

if (Storage::put('/', $file)) {
$filePath= Storage::url($file->hashName());
$filePath= Storage::url($file->hashName($tenant));
return $filePath;
} else {
$this->errorMessage = "Ocorreu um erro no servidor ao enviar foto. Tente novamente.";
Expand Down Expand Up @@ -121,4 +124,4 @@ function getExtension($name)
}
}

?>
?>
9 changes: 6 additions & 3 deletions ieducar/intranet/image_check.php
Expand Up @@ -83,9 +83,12 @@ function sendPicture(){

$file = new File($tmp);

$this->imageName = $file->hashName();
$tenant = config('legacy.app.database.dbname');

$this->imageName = $file->hashName($tenant);

if (Storage::put('/', $file)) {
$filePath= Storage::url($file->hashName());
$filePath= Storage::url($file->hashName($tenant));
return $filePath;
} else {
$this->errorMessage = "Ocorreu um erro no servidor ao enviar foto. Tente novamente.";
Expand Down Expand Up @@ -157,4 +160,4 @@ function getExtension($name)
}
}

?>
?>

0 comments on commit 5e71187

Please sign in to comment.