I have used a \File class for the first time and I encountered with problem. I get some path to file from frontend and I do not know is it a regular file or directory. So when I try to do some operations with this file I get an error about it is not a file...
Can you provide an example how to do some operation with file or directory defined by path? For example copy it in new location and we do not know is it file or directory.