Home Forums Front-end Issues Front end upload CV to user_id folder


Front end upload CV to user_id folder

    • isvaljek

    • September 11, 2013 at 6:19 pm

    Hi, I’m using ACF in combination with CF7 plugin. CF7 is used to create the form and one of the form fields is attachment doc (CV). This document is then intercepted and copied to uploads/user_data/$user_id/ folder, and attached to ACF file field (by creating wordpress attachment and update_field).
    The file field ends up populated with correct attachment, but I get this error on filesize (in post editor):

    Warning: filesize() [function.filesize]: stat failed for /home/company/public_html/demo/new-site/wp-content/uploads/wp-content/uploads/user_data/4/1378879571_8202_uid4_postid51_myimagefilename.png in /home/company/public_html/demo/new-site/wp-content/plugins/advanced-custom-fields/core/fields/file.php on line 81

    The user folders beneath uploads dir are created with mkdir 0755 and they seem identical to the ones used by ACF plugin.
    Also I should mention that uploading a file directly in post editor works as intended (no filesize error).

    • isvaljek

    • September 11, 2013 at 6:51 pm

    It turned out to be relative path for wp_insert_attachment (ended stored with duplicate ‘/wp-content/uploads/’ in path).
    Why the url worked even in that condition is beyond me.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.