DEV Community

alcivarv
alcivarv

Posted on

3

Laravel Image Upload

I am having issues displaying an image when uploaded. I am able to successfully store the image locally, however, the image is not doing two things:

  • The image is not storing under the original file name
  • I don't think my route works. Is there a class I need to reference to?

I am very new at this and have issues. thanks!

Top comments (1)

Collapse
 
victoravelar profile image
Victor Avelar

If your using the Storage facade it will generate a new name for each image, this is to avoid overrides on your server.

You need to store the filename once it has been stored, you will understand everything more clearly explained by the Laravel team themselves if you read the file upload section of the File Storage docs.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free