cameronasmith's avatar

Moving file with $file->move

Hi,

I'm moving the uploaded file with $file->move, but I would like to get the new filename returned, and although the method does return a file object it doesn't seem to be a way to get the new file name.

Does anybody have any suggestions?

Thanks,

Cameron

0 likes
3 replies
cameronasmith's avatar

Yes, but if there is an existing file then it does append it with the number next to it.

bashy's avatar
bashy
Best Answer
Level 65

Should be making unique filenames when moving. I add an str_random(12) on the end.

Please or to participate in this conversation.