Comments (14)
Please clarify this sentence: "try to access images on a specific page"
from vichuploaderbundle.
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.
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.
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.
Could you please specify how you "make images display"?
from vichuploaderbundle.
with this way : <img src="{{ vich_uploader_asset(picture,'imageFile') }}"/>
from vichuploaderbundle.
The "public" string should not be part of your URL
from vichuploaderbundle.
public is a symfony public directory. It's not a string.
from vichuploaderbundle.
"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.
Yeah but even I do uri_prefix :/images/annonces. I have the issue. I have no issue in my computer.
from vichuploaderbundle.
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.
i have that only for the images with vichuploder bundle config. The problem comes from the uri_prefix.
from vichuploaderbundle.
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.
thanks, i resolved it
from vichuploaderbundle.
Related Issues (20)
- Invalid Schema error while installing the bundle on Symfony 7 HOT 1
- The option "required" does not exist ? HOT 3
- Installation instructions are outdated HOT 2
- Document how to get s3 URL HOT 2
- Issue with VichUploader: unsupported MIME type "image/jpeg" HOT 7
- Install dose not register in bundle.php HOT 1
- Problem with delete when using multiple mappings on one entity HOT 1
- Using pure Annotation Does not Upload the actual file. @Vich\UploadableField HOT 3
- File injection on load not working reliabely with lazy ghost objects
- How to use metadata with VichUploader HOT 9
- The attribute reader should not trigger an exception for other attributes HOT 3
- Form type lazy load support HOT 3
- publicUrl method check looks for wrong exception. HOT 1
- Autowire services that implement NamerInterface HOT 3
- Logging of storage operations HOT 7
- Define default upload destination HOT 2
- Files ALWAYS gets downloaded even if `Content-Disposition` is set to `inline` HOT 8
- Build is broken HOT 1
- Capture HOT 1
- When uploaded file is too large for PHP, a 422 error is reported without much details HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vichuploaderbundle.