Add Item w/ File Column to a Pod from Front-End?

0

Hi! I'm trying to create a form on the front-end of my site that uses the PodAPI Import method to insert a new item into a pod that has an image column. I'm using the array-style parameter (as opposed to the CSV).

I've done this before (and it works great!) for pods that just have text and number fields, but now I'm trying to also add a file (an image) that's uploaded as part of the form.

How do you go about adding a image (to a file column) in a pod from the front end?

asked Jan 13 '11 at 5:40

wpries

11

add comment
enter at least 15 characters

1 Answer

0

I have a workaround idea, but it's not pretty:

  1. insert the record without the files using the API->Import method
  2. add the images to WP as attachments using WP function media_handle_upload()
  3. connect the attachment to the pods record using my own sql to insert into the pods_rel table

I really don't like step 3. But: a) would this work? b) isn't there a proper way to do this using the API?

answered Jan 14 '11 at 7:37

wpries

11

add comment
enter at least 15 characters