• Resolved gpspake

    (@gpspake)


    I’m working on a plugin that requires a certificate to be placed on the server. Right now, users have to manually add the certificate to the plugin directory which requires ftp access.

    I’d prefer to give users a way to upload the file directly to the server from the plugin options. I assume this is relatively easy, right?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Easy relative to what? 😉

    You provide a file input field on your plugin form, the file is copied to the PHP temp directory by the browser upon form submission. From the temp directory you move the file to it’s final destination. See the PHP Documentation.

    Be sure only trusted users can upload files or the door is opened to all sorts of malfeasance. Also do the usual validation things since even trusted users can be fooled in uploading malicious files.

    Thread Starter gpspake

    (@gpspake)

    Thanks. After some Googling, I realized I’ve actually done this before and I should be able to work it in to my plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Upload files to a plugin directory from plugin options.’ is closed to new replies.