We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Is there a way to save a channel form file upload value while user logs in?

How Do I?

Varen's avatar
Varen
150 posts
5 years ago
Varen's avatar Varen

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 Sowell's avatar
Robin Sowell
13,160 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Wonder if it’s just gone from tmp by that time?

Would it be easier to allow guests to actually post the entry, have a way to indicate who posted it, and then garbage collect to get rid of the entry if they don’t sign up in 24 hours- or what have you?

       
Varen's avatar
Varen
150 posts
5 years ago
Varen's avatar Varen

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!

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
5 years ago
Robin Sowell's avatar Robin Sowell

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!

       
Varen's avatar
Varen
150 posts
5 years ago
Varen's avatar Varen

Robin, I’m going to chew on that advise for a bit but will also be searching for an emoji for “over my head” 😉. In the meantime, I was a dork and forgot to add the url in the post above which was going to show you the form in question. https://isawyou.com. Thanks

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.