Skip to content

Commit

Permalink
ElementFile customize tempDir
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Aug 23, 2023
1 parent f229919 commit 24588c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/php/libAllure/ElementFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class ElementFile extends Element
public $isImage = true;
public $destinationDir = '/tmp/';
public $destinationFilename = 'unnamed';

public $tempDir = '/tmp/libAllureImageUploads/';

private $tempName = null;

public $imageMaxW = 80;
Expand Down Expand Up @@ -67,7 +70,7 @@ public function setDestination($dir, $filename)

private function moveFileToTemp()
{
$this->tempName = tempnam('tempUploads', uniqid());
$this->tempName = tempnam($this->tempDir, uniqid());
$mov = @move_uploaded_file($_FILES[$this->name]['tmp_name'], $this->tempName);

if (!$mov) {
Expand Down

0 comments on commit 24588c7

Please sign in to comment.