Greetings!
I’ve been struggling with fixing this problem for some time now…
I cannot get the full image path to output on either the “Edit Entry” page or any “Template” page.
To keep it simple, I have a custom field with a shortname of: product_image
It’s using filedir_1 which is configured like this:
• Server Path: /var/www/vhosts/website.com/httpdocs/uploads/products/
• URL: http://www.website.com/uploads/products/
• Both directories (uploads and products) are set to 777.
• I am not using MSM.
• the system folder is BELOW the root.
• I’m using the latest and greatest EE 2.5.0
File Field Outputting:
———————————————————————————————————————————
1. Outputting the variable:
{product_image}
produces:
<!-- empty -->———————————————————————————————————————————
2. Outputting the variable:
{product_image:large}produces:
_large/myimage.jpg
———————————————————————————————————————————
3. Outputting the variable pair:
{product_image}
{filename} | {extension} | {url}
{/product_image}produces:
myimage | jpg | myimage.jpg
———————————————————————————————————————————
Now, this wouldn’t be that big of a deal as I could simply manually hardcode the directory path in the template; HOWEVER, after the image has been uploaded and saved to an entry in the control panel, you cannot resave that specific entry WITHOUT the image being removed from the field and receiving an error saying:
You do not have access to the directory specified for this field
The reason this is happening is because the “Edit Entry” page is only outputting:
_thumbs/myimage.jpg
which obviously in itself is a broken path. It should be:
/uploads/products/_thumbs/myimage.jpg
So to get around this, the client would have to re-select the image (for every File field) anytime they make a change to the page; otherwise, the image is removed automatically.
———————————————————————————————————————————
Looking at the database table:
_files:
upload_location_id: 1
rel_path: /var/www/vhosts/website.com/uploads/products/myimage.jpg
mime_type:image/jpeg
file_name: myimage.jpg
_upload_prefs:
id: 1
site_id: 1
name: Product Images
server_path: /var/www/vhosts/website.com/httpdocs/uploads/products/
url: http://www.website.com/uploads/products/
allowed_types: img
cat_group: 2|1|3
_channel_data:
entry_id: 10
site_id: 1
channel_id: 3
field_id_12: myimage.jpg
_channel_fields
id: 12
site_id: 1
field_name: product_image
field_type: file
field_content_type: image
———————————————————————————————————————————
I’ve tried the following to troubleshoot:
• overriding the upload directories via the config.php file
• upgrading from 2.4.0 to 2.5.0
• reinstalling ExpressionEngine 2.5.0
• using a relevant URL path in the file upload settings as well as a full URL path.
• reinstalling the /ExpressionEngine/libraries/File_field.php
• reinstalling the /ExpressionEngine/libraries/File_integrity.php