Sunday, 8 September 2013

Allow users to upload multiple images each - options limited

Allow users to upload multiple images each - options limited

I have a plugin that uses a profile page to allow users to upload more
than one picture (only one at a time though). I am trying to figure how
exactly to handle the uploads- I don't see wp_handle_upload attaching any
user_id to the uploads, and media_handle_upload must be associated with a
post_id.
Ideally id like wordpress to handle the file upload, validation, resizing,
etc. But I also need to have access to direct link to the image uploaded.
I also need for each user to be allowed to upload several image files,
which I am not sure is even possible using wp_handle_upload without
overwriting the first uploaded file.
Do I have any other options available to me? Would uploading to the server
and storing the file location in my own sep database make more sense here?
Also the files will be made available on the profile page via an icon for
each uploaded picture. So they need to be associated with something like
the user_id - which isn't hard, but I don't see the built in WP functions
providing that.
This is my first attempt at a plugin that functions this way, am I
overlooking something obvious?

No comments:

Post a Comment