Support

Account

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

Solved

Front end upload CV to user_id folder

  • 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).

  • 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)

The topic ‘Front end upload CV to user_id folder’ is closed to new replies.