How to upload xml file to a path in wordpress plugin?

I’m writing a custom plugin to import data from a custom xml to a WordPress database. After activating plugin and uploading xml file, it is showing error “sorry, only xml files are allowed”. I have used only xml file. but I’m not sure why the file is not getting uploaded to location. I echoed location and file name, but file name is not being displayed. I’m using php code for upload section. not sure I’m following right way. here is the snapshot and code

enter image description here

Read More

Here is the code url: code here

Related posts

1 comment

Comments are closed.