-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files uploaded in front-end entry form are lost #57
Comments
@mrw Mind sharing your temp fix for this? |
@sjcallender yes, in if (!empty($_POST['is_fe_upload_form']) && $_POST['is_fe_upload_form'] == 'yes') {
return;
} Then in our front-end form we added this: <input type="hidden" name="is_fe_upload_form" value="yes"> It's not great but it works! |
Thanks @mrw! |
Hey @aelvan, has this behavior ever been resolved? |
Er, sorry, @aelvan, i have no idea why i tagged you. Should've been @jalendport! |
I just discovered the same issue. However, only with uploading new user photos in front-end user profile forms as per https://craftcms.com/knowledge-base/front-end-user-accounts#user-profile-form. In private function resetUploads()
{
// $_FILES = [];
unset($_FILES);
// UploadedFile::reset();
} |
Also seeing this behaviour, exactly as @ademers describes it. Craft 3.7.37, Preparse 1.4.0. I have a fork setup if it helps anyone. Add the following to your
Then run |
This still seems to be an issue in CraftCMS 4.6.0 and Preparse 2.0.2. |
Fix for frontend image uploads issue as per jalendport#57 (comment)
Hi! Thanks for your great work on Preparse. I think this issue is related to #23 and #52.
Starting in 1.0.7, files uploaded as part of a front-end entry form aren't working for us, with Craft 3.1->3.3. The entry is getting saved properly but the file is disappearing. I tracked this down to the
resetUploads()
method in PreparseField.php.I know you changed it from
unset($_FILES);
to$_FILES = [];
to fix some issues, but that's still a problem for us because the file is getting lost. I hacked a fix for it for now (by adding a hidden field to our entry form and then returning early fromresetUploads()
if it's present) but I know that's not a permanent fix if we upgrade in the future.Do you have any ideas on other fixes for this?
Thanks!
The text was updated successfully, but these errors were encountered: