• Resolved lbnn

    (@lbnn)


    Hello,

    I have several fields in BuddyPress that contain some HTML code inside.
    When I fill the field manually in the website there is no problem.

    I tried to export the field and everything is okay.

    But now if I want to create a user with the same value, I get the following error : Problem uploading file to import. Error details: ‘You do not have permission to upload this type of file.’

    If I remove this field and the value contained in it, it works…

    How can I import users with such types of fields ?

    Here is an example of the value contained in the field : <a href="https://mywebsite.com/members/brian-kitchen/">Brian Kitchen</a>

    When I export it the value is a bit different : "<a href=""https://cousinadefrancoispasquier.fr/membres/anne-bonin/"">Anne BONIN</a>"

    I tried both and it fails every time.

    Please, found me a solution, I have 3 fields for each user that contain such values.

    Thank you for your help.

    Wordpress version : 6.0.1
    BuddyPress version : 10.3.0
    Theme : BuddyX 4.3.9
    Website URL : Private website closed for public people

    • This topic was modified 3 years, 11 months ago by lbnn.
    • This topic was modified 3 years, 11 months ago by lbnn.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @lbnn,

    I am not sure about your problem. The problem is the ” that appears or that the string changes and contains value from another user?

    Thread Starter lbnn

    (@lbnn)

    Hello @carazo,

    Thank you for paying attention to my question.

    The problem is that it seems that I can’t import a user with a field containing some HTML code.

    The field is supposed to contain an HTML link, but no matter what the link is referring to, I got an error when trying to upload.

    I’m not teaching you anything if I told you that a link in HTML can be written like this : <a href="https://test.com/">Test</a>

    I need this value in a field but can’t import it, it fails every time I try.

    So I try to insert it manually in my website and export it to see where I’m mistaken and got this result in the exported file : "<a href=""https://test.com/"">Test</a>"

    And when I try to import with the same value it also failed and if I remove it from the file, the file is well imported so I think there is something wrong somewhere.

    Is it more clear ?

    Plugin Author Javier Carazo

    (@carazo)

    Could you tell me which error appears?

    HTML code can contain malicious code so surely the problem comes from there.

    Thread Starter lbnn

    (@lbnn)

    @carazo

    Yes, of course but since you need to be admin to run the tool and that it’s a private website for private use, it would be great to be able to do that.

    I get this error : Problem uploading file to import. Error details: ‘You do not have permission to upload this type of file.’

    If I remove the field of the .csv file, it works…

    Plugin Author Javier Carazo

    (@carazo)

    @lbnn,

    This is not a problem created by this plugin.

    This error is thrown out of this plugin. Something checks some security issue and raise this error, stopping this plugin.

    Check if you have some security plugin activated and also, include this directive in wp-config.php: define(‘ALLOW_UNFILTERED_UPLOADS’, true);

    Anyway, remember: this is a free plugin, I work for free in it for hours and I give free support asap, but I cannot attend to personal problems (more in this case that the problem comes from another part of your site).

    Thread Starter lbnn

    (@lbnn)

    @carazo

    Yes of course I fully understand.

    I already tried to add this code in wp-config.php but doesn’t change anything :/

    I’m not sure because when I add it manually in the profile field directly in the website, it works, it’s only during the import part that it fails.

    I think it’s a problem related to ” characters.

    I succeeded to create a user with this in the file "<a href"="https://test.com">Test</a>"

    But the result on my website is : Test

    Then I need to update database to remove the ” manually, it’s really not the best practice but it works, if you have an other idea, don’t hesitate 😉

    • This reply was modified 3 years, 11 months ago by lbnn.
    • This reply was modified 3 years, 11 months ago by lbnn.
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Problem importing file containing HTML code in some fields’ is closed to new replies.