Cant figure out how to get file name
from folder in ````filePath```
use Illuminate\Support\Facades\File;
$filePath = storage_path('app/apiFiles/'.auth()->user()->id_message.'/');
$fileName = File::files($filePath);
dd($fileName);
dd($fileName)
return array but i need only filename
is possible to separated from array?
what i need from array is only this filename: "Z1iZ03gEhltPZj2Z2Rxnnuga2eXywheL4pQc5q0I.zip"
array:1 [▼
0 => Symfony\Component\Finder\SplFileInfo {#293 ▼
-relativePath: ""
-relativePathname: "Z1iZ03gEhltPZj2Z2Rxnnuga2eXywheL4pQc5q0I.zip"
path: "/var/www/html/domain/storage/app/apiFiles/910960"
filename: "Z1iZ03gEhltPZj2Z2Rxnnuga2eXywheL4pQc5q0I.zip"
basename: "Z1iZ03gEhltPZj2Z2Rxnnuga2eXywheL4pQc5q0I.zip"
pathname: "/var/www/html/domain/storage/app/apiFiles/910960/Z1iZ03gEhltPZj2Z2Rxnnuga2eXywheL4pQc5q0I.zip"
extension: "zip"
realPath: "/var/www/html/domain/storage/app/apiFiles/910960/Z1iZ03gEhltPZj2Z2Rxnnuga2eXywheL4pQc5q0I.zip"
aTime: 2020-10-22 06:46:37
mTime: 2020-10-22 06:46:37
cTime: 2020-10-22 06:46:37
inode: 1308192
size: 3180822
perms: 0100644
owner: 33
group: 33
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
}
]
via Chebli Mohamed
1 commentaire:
PHP7 Sodium Encryption Decryption
PHP Server Side Form Validation
Contour Detection using Python OpenCV
HTML Table Alternate Row Color using PHP
PHP User Authentication by IP Address
Python Pandas CSV to Dataframe
Enregistrer un commentaire