Search code examples
phpphp-5.4php-5.5

Show an image from an ubuntu server


I have a problem on my side.

So I created a script that upload resize and upload files on a server : /tmp/117x117/6.jpg.

In the template I have :

<img src="{{ record.image_path }}" alt="" style="width: 50% !important;"/>

I look in the source of the page and in src of this image I have /tmp/117x117/6.jpg and the image is not shown.

Can you help me please ? Where's the error?

Thanks in advance and sorry for my english.


Solution

  • After uploading the file (image) you should also move the file in the document root folder of the web server.

    Please read the PHP documentation for uploading files And check the method: move_uploaded_file()