• Resolved killian1726

    (@killian1726)


    Hello, I am currently building a WordPress website, and I’ve been coding a php script that is supposed to handle the upload of pdf files to the server.

    The point of this program is for the user to be able select a pdf file from his computer, and when he uploads it, the files has to be moved to the directory /wp-content/upload/factures/file.pdf, which I already created manually.

    I’ve already done this type of php program on other projects (but not using WordPress), and each time I was using the php function “move_uploaded_file()”.
    But with WordPress, I can’t manage to find a solution to move the file to the directory, although I am sure I am using the right path, it tells me that the directory doesn’t exist.

    Does anybody know if there is a more simple method to automaticly upload files to a wordpress website without using a plugin? Is there any wordpress function that can do the job other than move_uploaded_file()?

    I hope my question is clear, and thank you in advance, any piece of information would be much appreciated !

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi

    Please check this link.

    If you don’t want to insert the file information in the database then you can remove the insert statement.

    I hope this will help you.

    Kind Regards

    Thread Starter killian1726

    (@killian1726)

    Hi,

    Thank you very much it helped me a lot !

    Have a great day !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uploading files using php move_uploaded_file() function’ is closed to new replies.