Php chat and file transfer

Hello,
is there any way to send a file during chat with php

even if now directly sending a file, simply upload a file and the other user sees the link

Regards