There are two methods to upload a file in your php project.One is upload file in a directory another is upload file using php base64_encode.For upload a image file and save it to a directory follow this url.In this article we will know how to upload a file using php base64_encode and show it in your html form.Suppose we upload a image file in php base64_encode.For that you need to create a html form.Like this
File Upload HTML
After that go to your desired action file.And follow the below code.
php base64_encode and display
Let see what we did.First i get the file contents using file_get_contents(fileUrl).Then i use a php method that is base64_encode.Then you will get a encoded data,save it in your database.And follow how it show in html img tag.