Upload image before parent creation?

So let’s say you are posting a new article, post, whatever… and want to upload an image.

I have an images table that links to the article_id, but the article_id is not yet known since it hasn’t been created it. This is obviously a non-issue on edit.

Just wondering, is there a general way to go about handling this?

I need to store a bunch of details about the image, which is fine - it’s just the link to the article_id that is missing. Due to a foreign key constraint I can’t really just assign it a (temporary) value of 0 or something, either…

Can’t you just create the article directly and set add a “show” value in the DB or something? Just set a value inidcating that the article is published when you’re done editing. That should solve your problem :slight_smile: