ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

File field not rendering file url

November 12, 2012 9:42pm

Subscribe [1]
  • #1 / Nov 12, 2012 9:42pm

    AniM

    7 posts

    We are using File fieldtype and we are using it in channels to save files (including images) with associated descriptions.

    Since few days ago the links to these files (displayed on our web page) stopped working and we saw that the URL are not out-putted.

    If we check the channels we see the file exist, if we check the “File manager” we see the file exists. If we FTP and check the physical folder we see the files do exist.

    Now we did have some issue with Server Path setting in the File Upload preferences where the setting was chnaged to something else. So we have corrected these settings for all our File Upload preferences (we have few folders) but we are not getting the channel File field to render the file url in the template.The URL is rendered as empty string.

    Out of curiosity I looked in the EE database in the exp_files table and found all those files do exist in there but in the rel_path field, the server path for all files is incorrect! Is that the problem? How do we fix it? I tried to synchronize the File Upload preferences but that didn’t help. I didn’t get any errors but the rel_path was not corrected. Do I need to upload all files? The folders have been set to 777 permissions

    Please help, we are going live in a week and this is big issue for us.

    We are using EE 2.5.2 build date 20120606

  • #2 / Nov 13, 2012 9:35am

    glenndavisgroup

    436 posts

    Hi AniM,

    BEFORE YOU TRY ANY OF THE BELOW PLEASE MAKE SURE YOU MAKE A BACKUP OF YOUR DATABASE!!! I’M NOT RESPONSIBLE FOR ANY DAMAGE OR ERRORS THE INSTRUCTIONS BELOW MAY CAUSE TO YOUR DATABASE.

    You have 2 options:

    Option1:
    - Try correcting the rel_path field in the db manually to what it’s supposed to be for 1 of the images and see if that works. You can use phpMyAdmin or the like to do that. If it works then go a head and apply the corrected path to all the other files as well.

    Option2:
    - Re-upload one of the images using your EE cpanel. Then go to the db table and check if the rel_path field changes to the new folder structure you have in place for the new image you uploaded. If so, then manually change the rel_path for all the other images accordingly.

    Let us know how that goes.

    Thank you,

    Mike

  • #3 / Nov 14, 2012 11:51am

    AniM

    7 posts

    I had tried option 2 and apparently what I see in the rel_path field is consistent. No matter what my servers path is that field gets the same value. So with observation option 1 won’t

    Now I did find after some research that we instcalled Matrix field type in that period. Is there a known issue with Field type not working when Matrix type is also installed? We are using. Matrix with File filed type as one of the columns and that is working. It is only when we use the File field type by itself get we seem to have a problem.

  • #4 / Nov 14, 2012 11:59am

    glenndavisgroup

    436 posts

    Try clearing the EE cache and synchronizing your folders under File Upload Preferences and see if that changes anything.

  • #5 / Nov 15, 2012 10:35am

    Dan Decker

    7338 posts

    Hi AniM,

    I’m sorry for the trouble you’re having with the file manager!

    Any time you make changes to paths or URLs, it is wise to sync the File Manager. You should not have to touch the database under most circumstances.

    To run a sync, Content-> Files-> File Upload Preferences and click the Sync icon next to each Upload Destination.

    If that doesn’t get your files behaving properly, let me know and we’ll come in for a closer look!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases