@gssj85 yeah, putFile uses the stream, exactly. for path sanitization, if your path includes special chars such as / or _ or - they will be encoded in the URL so you need to escape them. Str::slug() is very useful I use. I see you ar using a static name $tempFileName but you should think about what will happen if you store the same file twice
@azimidev The $tempFileName turns into a new name with putFile(), it's just that I need to put the binary string into a file before passing it to putFile() because it doesn't accept the binary string directly.
It makes a copy with another unique name, then unlink() deletes the temporary file (also a unique generated name in /tmp with a prefix (sufix?))
@gssj85 not sure if it's documented, but it will accept also plain string of file, so you should be fine (as I used this in my project :]). However there is second method put I'm using:
@Yorki I'm going to test this, following strictly documentation because I'm new no much other sources haha
Way I see in the docs the put method accepts a Resource as second paramenter (I think getContent(true) gets a resource? without it it's a plain string).
However the first parameter is the name of the file, different from the putFile() method which the first parameter is the directory path and the file name is autogenerated.
I think my fight here is wherever I should stop using framework helpers and use native php, like I'm using putfile() because of the facility of the unique name.