On the broken image picture if I copy the url link and past it in my browser I get a file not found error even though the images are there in the exact same directory.
3145
Please help. I need to show images in list view for each id.
Confirmed that /idiotonwheels/images exist. Nevertheless, I get this error
PHP warning
move_uploaded_file(/idiotsonwheels/images/12310843logo-2.png) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: No such file or directory
/Applications/MAMP/htdocs/yii/framework/web/CUploadedFile.php(197)
No you need to save to a path, not a URL. Use basePath(), but ensure the path that you save to is accessible. If you want it in an images directory, try something like:
In the view file you should be using a URL, not a path.
When you’re saving the image to the file system, you need to provide a path, so PHP knows where to put the image.
When outputting the image tag in a view, you need to provide a URL, so the user’s browser knows the address where the image is located.
You also need to ensure that the file is saved into a folder within your web root. Your application folder shouldn’t be accessible to web users, while your web root is.
As Keith has stated, a file should be accessed using "PATH" when you create/update/delete in your application, but it should be accessed using "URL" by your users using their browsers.