BuddyDev

Search

[Resolved] Xprofile Field Types – upload txt files

  • Participant
    Level: Initiated
    Posts: 2
    Tarod on #16347

    I would like to upload txt files using the File field, but I think the supported extensions are pdf and doc according to the following code:

    $extensions = array(
    ‘file’ => array(
    ‘doc’,
    ‘docx’,
    ‘pdf’,

    I’ve added a new line with the string ‘txt’ to that array with no luck. I get the same error (“Invalid file”) when I try to upload a txt file.

    Any idea?

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #16350

    Hi Tarod,
    Thank you for posting.

    1. Please make sure that the file size is greater than 1 KB(We have a rounding function that rounds to zero and causes the above message if file is less than a KB). In next update, we will remove the rounding from testing file validity.

    2 You will still get security error. Please install WP ADD Mime Types plugin and add the following two types(as shown in red)
    https://i.imgur.com/UELQYh9.png

    After that, you will be able to upload text file.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 2
    Tarod on #16351

    Hi Brajesh Singh,

    I reviewed yesterday the code and I saw the requirement about the file size. Thanks.

    I had already added the txt type to my WordPress so I didn’t get the error due to that.

    Thank you very much!

    Frank.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #16354

    Hi Frank,
    Thank you.
    I am assuming that it works with the above condition for you now?

  • Participant
    Level: Initiated
    Posts: 2
    Tarod on #16365

    Hi Brajesh Singh,

    Yep, it works like a charm.

    Thanks,

    Frank.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #16371

    Thank you Frank 🙂

The topic ‘ [Resolved] Xprofile Field Types – upload txt files’ is closed to new replies.

This topic is: resolved