Uploading files using php move_uploaded_file() function
-
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]
- The topic ‘Uploading files using php move_uploaded_file() function’ is closed to new replies.