So I've been using ftp functions (manually setting $conn_id, making fpt_put($conn_id,...), conn_close etc) in my project,
now I've added "use Storage" in my controller, set host, username and password for ftp in filesystems.php and changed all the functions in my controller to "Storage::" type.
The problem is that my files get damaged while uploading on the storage. After upload files successfully appear (I've tried uploading on both local and remote ftp storage), but I can't open them, getting the "Could not load image" error on files put in my /storage/app folder and empty square when opening an url from the remote storage. While I was using ftp_put(...) and stuff, everything was working perfectly.
The only thing I've noticed is the error explanation given when trying to open a file placed in /storage/app:
Error interpreting JPEG image file (Not a JPEG file: starts with 0x2f 0x76)
What could this one mean and how could I handle this situation? Would highly appreciate any possible help!
UPD: looks like the file somewhere during the upload stops being a file of its native format, and then gets renamed back forcibly, which causes corruption. Like, I upload .jpeg file, something happens, then it gets saved with .jpeg at the end, not being a .jpeg anymore. Still no idea.