Giter VIP home page Giter VIP logo

Comments (14)

garak avatar garak commented on September 22, 2024

Please clarify this sentence: "try to access images on a specific page"

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

if the uri_prefix in vich config is : ./images/annonces. All images are displayed when I go domainename/symfonyapp/public but this doesn't work if I go another page like domainename/symfonyapp/public/annonces/auto except i do ../images/annonces in the uri_prefix.

from vichuploaderbundle.

garak avatar garak commented on September 22, 2024

You're supposing that everyone can understand the meaning of "images are displayed" or "this doesn't work".
If you want help, you need to give a way to understand your situation

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

If you set the uri_prefix configuration in your VichUploaderBundle config file to ./images/annonces, all of the images stored in the /public/images/annonces directory will be displayed correctly when you access your Symfony app using the URL domainename/symfonyapp/public. However, this configuration will not work when you try to access a specific page within your Symfony app, such as domainename/symfonyapp/public/annonces/auto.

To make the images display correctly on this specific page, you need to modify the uri_prefix configuration to ../images/annonces. This will tell Symfony to look for the images one level up from the current directory, which will allow the images to display correctly on the specific page. However, if you go back to the root directory, the images may not display correctly because Symfony will be looking for them in a directory that does not exist.

from vichuploaderbundle.

garak avatar garak commented on September 22, 2024

Could you please specify how you "make images display"?

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

with this way : <img src="{{ vich_uploader_asset(picture,'imageFile') }}"/>

from vichuploaderbundle.

garak avatar garak commented on September 22, 2024

The "public" string should not be part of your URL

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

public is a symfony public directory. It's not a string.

from vichuploaderbundle.

garak avatar garak commented on September 22, 2024

"public" is a string. The name of a directory is a string.
I can only guess (since you don't provide info) that you didn't configure properly your virtual host.

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

Yeah but even I do uri_prefix :/images/annonces. I have the issue. I have no issue in my computer.

from vichuploaderbundle.

garak avatar garak commented on September 22, 2024

Let's make it short: do you have the same problem if you try to generate the URL for any of your static files, directly with the asset helper?

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

i have that only for the images with vichuploder bundle config. The problem comes from the uri_prefix.

from vichuploaderbundle.

garak avatar garak commented on September 22, 2024

You said you only have this issue only in a specific environment, so the problem Is not with uri_prefix configuration.
Every Symfony request passes from the same front controllers, so there's no match between URL paths and directories.
I suggest you to re-check the way you're using your routes and, again, to properly configure your virtual host, following official Symfony documentation.

from vichuploaderbundle.

kasali avatar kasali commented on September 22, 2024

thanks, i resolved it

from vichuploaderbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.