Front-end file upload?

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  chris.pilko 1 year, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #167279

    tr3online
    Member

    Hi guys,

    To start off, I’d like to establish that I’m new to WP and even newer to Pods. I’m moving over from drupal. I must say this is quite the plug-in. I just started playing with it the other day and am loving the flexibility.

    Now for my question, which will probably fork in to a few more as I develop it:

    Is it possible to create a frontend user file upload form in pods? Ideally I’d like to have a simple form where public users (that are logged) can upload .doc/.docx files to a pod. This list would then be viewable / sortable / manageable on the front end (as well as the back-end by the admin of course). I know how to make the list viewable on the front/back end, once the fields are populated, but I have no clue how to make the front-end form to allow users to upload actual files. Would I use publicForm()?

    Any help would be much appreciated!

    Thanks in advance,

    Tre

    #167280

    chris.pilko
    Member

    Yes, publicForm() works exactly as advertised. It creates a form that any member of the public can use to add data to your Pod.

    Permission restrictions need to happen on your end though. Here is some code that I use on one of my sites for user validation.

    #167281

    tr3online
    Member

    Awesome! Thanks for the insight.

    Appreciate the fast response,

    Tre

    #167282

    chris.pilko
    Member

    Yes you can, but I might not.

    To manage who gets to edit their own pod, you can use the Auto Set Current User package on a Pick field in your pod set to relate to the WP_users database. Using this code, you can make sure that only a user that owns a piece of data can edit it. You do need to be careful with this plugin that administrators don’t take over the pod when they edit it.

    You could very easily create a "Manage my data" screen with a listing of all that user’s columns followed by View, Edit and Delete links. The delete link would use a Pod API call.

    Rather than allow a stranger delete access to your database, you might just want to add a checkbox field like "Mark for Deletion" on the Edit screen. Once a user checks this you wouldn’t display this data anymore to the general public, and an Admin (or a cron job) would then delete it.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting