I have a front-end channel form that has an image upload field. I have the form visible for all visitors to use but if they’re a new user without being logged in I give them an option to either join or login AFTER they’ve filled out the form. I am saving all the form data to local storage using javascript but no matter what I do I find it impossible to save the file path they have selected.
The result is that after filling the form, registering an account, and then posting the entry they have written, if they had selected a image file to upload that data is not restored and not submitted with the form.
I’ve tried all sorts of scripts, cookies, local storage, jquery, even rubbing my jeanie bottle wishing it to work. If anyone has done this or knows how I would be extremely grateful if you could tell me. Much thanks!
Robin,
“Wonder if it’s just gone from tmp by that time?”, not sure what you mean by this…
It WOULD be easier to do as you suggest (although I don’t necessarily have the skills to do so) but we have specific reasons for doing it the way I suggested. Unfortunately, I still can’t think of a work-around… you can see the form in action here, perhaps if you took quick look at it you’d see more clearly what I mean. Thanks
In the meantime, I discovered another issue I’m going to post about separately concerning Appe’s new iPhone image format and errors in EE.
Thanks for your suggestions!
I don’t have the js skills to ‘get’ how you’re handling it, so I noodled it with the team, and the thinking is that file path wouldn’t upload a file. It has to be an actual file upload in the $_FILES PHP global. So you’d want to make sure you’re POSTing it as a multipart form and the file element is an actual file input in the DOM, visible or otherwise.
I get the php end of things- hopefully you get how it would tie into local storage!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.