Rename Image while uploading using phpinfo in PHP | Move uploaded File Function

Publicado em: 03 Agosto 2020
no canal de: Knowledge Thrusters
11,514
157

This PHP Tutorial explains how to rename a file while uploading and insert the same name in database in php.

Steps:
Create a form for file upload
Create a db file
rename file
move to folder
insert into database

Before renaming , get the extension of the image. For that I have used phpinfo with option extension. As that will return the extension of the file uploaded.

Phpinfo has 4 elements - directory name, basename, extension and filename.
if option is not defined, it will return array, else it will return string.

For rename, I have passed string and current date combined with randomno so that no two image will have same name.

After rename, move to folder with move_uploaded_file function in which file temporary name and directory name will be passed.

If uploaded in folder, then insert that into database table.


If you are downloading code, Create a folder upload in your project folder
Code link
https://github.com/sushma-singh-yadav...


#php #knowledgethrusters


Nesta página do site você pode assistir ao vídeo on-line Rename Image while uploading using phpinfo in PHP | Move uploaded File Function duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Knowledge Thrusters 03 Agosto 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 11,514 vezes e gostou 157 espectadores. Boa visualização!