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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay