Photo upload before parent model created

Posted 3 years ago by cbaswell

I'm in need of some help. Let's say for example that I have a form to create a new car. A section of the page is for uploading photos of your car. I'm using plupload to provide drag and drop ajax uploads. I have an endpoint set up that saves the files to the filesystem, creates a database record then returns a response to plupload. The trouble is that I don't actually have a car model created yet. So how do I save the photos in a way that I can link to them when I actually submit the form with all the car details (without creating a temp car)? And how do I do some cleanup if they don't end up submitting the form? I've been racking brain over this for too long now. If any one has an idea, I'd greatly appreciate some help.

Please sign in or create an account to participate in this conversation.