Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After finishing the upload and saving the node, the file still is showing in the system temporary directory.
I would expect the file to be listed in the files directory and use the path provided on the file field settings page.
Comments
Comment #2
veronicaSeveryn CreditAttribution: veronicaSeveryn at Inclind Inc commentedTo make it work together with Plupload, I am linking to the issue which contains description/instructions (https://www.drupal.org/node/2245927#comment-11259977).
There're 2 patches involved to make it work the way I had it done.
Comment #3
veronicaSeveryn CreditAttribution: veronicaSeveryn at Inclind Inc commentedMarking for review
Comment #4
david_garcia CreditAttribution: david_garcia commented@veronicaSeveryn Thanks for the patch!
I can't review and commit a feature that depends on an uncommited feature from another module, so I'm marking this as needs work ether until #2245927: Create helper function that will save uploaded files to file_managed table gets in or a different approach is proposed.
Yet I am not sure this is the right direction. The Plupload form element module provides that... just a form element, so it has no knowledge of widgets or file configurations.
I'm not sure if it is "our duty" to move this away from the temp folder.... may taking a look at the original value function from the parent classes:
Comment #5
Chipie CreditAttribution: Chipie commented@veronicaSeveryn: Thanks. Works for me.
Comment #6
steveoriol@veronicaSeveryn: Thanks. Works for me too with the following:
NOTE:
In fact, this works only for the fileld type "file" but not for the fileld type "image" ...
Comment #7
khiminrm CreditAttribution: khiminrm at Lemberg Solutions commentedHi!
Solution doesn't work in 8.4.2. Any suggestions? Thanks!
Comment #8
khiminrm CreditAttribution: khiminrm at Lemberg Solutions commentedI was able to upload file after changing public folder permission to 777 recursively.
But I've noticed that filename is not appeared near 'Remove' button and I upload new file, after removing uploaded one. Error occurs:
The website encountered an unexpected error. Please try again later.
Comment #9
khiminrm CreditAttribution: khiminrm at Lemberg Solutions commentedWithout any changes in code widget stopped working. After uploading file there is only Remove button without file's name and error after saving form as in #8
Comment #10
khiminrm CreditAttribution: khiminrm at Lemberg Solutions commentedErrors in #8 and #9 have disappeared after flushing site's and browser's cache.
Still one bug: file is not removed from folder when it's removed in admin page from media entity or when whole media entity is removed. Cron also doesn't remove such file. How it can be fixed?
Comment #11
khiminrm CreditAttribution: khiminrm at Lemberg Solutions commentedI've found answer for question in #10 about deleting files. It's related to https://www.drupal.org/node/2891902.
Comment #12
khiminrm CreditAttribution: khiminrm at Lemberg Solutions commentedPatch from #2 works for me with patch from https://www.drupal.org/project/plupload/issues/2245927#comment-11560277. Thanks!!!
Comment #13
Alex Zhulin CreditAttribution: Alex Zhulin commentedUsing:
- Drupal 8.5.3;
- Plupload library 2.3.1;
- plupload 1.x-dev with applied patch from https://www.drupal.org/project/plupload/issues/2245927#comment-11560277 (#7);
- plupload_widget 1.0 with applied patch from #2.
Some file uploads fail because the regular expression parsing element ID does not consider the underscores in the hash appended to the ID after AJAX.
Also extra records are created in the file_managed table for the same file with "temporary://..." uri.
Created a patch based on #2 to fix these issues.
Depends on a patch from https://www.drupal.org/project/plupload/issues/2245927#comment-12596975 (#13).
Comment #14
plato1123 CreditAttribution: plato1123 commentedWait, this has been broken for 2 years? Can't we get these patches rolled into a release, even if it's just a dev release?
Comment #15
budalokko CreditAttribution: budalokko commentedChanged issue name to clarify file status is permanent. The problem is it is stored in temporary folder.
Attached is a very small patch that I think solves the problem but I have the feeling I'm missing something because its tiny compared to previous patches and does not involve changes in Plupload Module.
It seems to be working fine for me on:
- Drupal Core 8.5.5
- PlUpload dev - at 20/7/2018 (30f4c1fa42ae2f076d31289433cdb9b35ed72f16)
- PlUpload library 2.1.9
Comment #16
Yaazkal CreditAttribution: Yaazkal commented#15 seems to do the trick, thanks.
Comment #17
WorldFallz CreditAttribution: WorldFallz commented#15 seems to be working well for me so far also. Combined with #2662696-16: multiple values setting for a field are not taken into account when saving, only first file makes this the perfect module for bulk uploads.
Comment #18
masande CreditAttribution: masande commentedI've combined #15 with patch in #2662696 and am getting each image added via plupload uploaded twice. I only applied this patch to FileWidget.php. Do I need to also change ImageWidget.php to match FileWidget.php? Anyway someone could provide a patch combining the patches fixing both issues? Thanks!
Comment #19
budalokko CreditAttribution: budalokko commentedAttached patch is the same as #15 regarding file widget and fixes image widget too.
@masande: The duplicate files issue is due to "file_copy" in #2662696-12: multiple values setting for a field are not taken into account when saving, only first file. It should be a file_move. I have a combination of patches which I think is working fine. I won't send it here because it combines at least 4 issues from this issue queue and I think we should face each problem separately but feel free to PM me and I will send it. For the multiple files problem its based in #2986932: Add multiple file support.
Comment #20
AstonVictor CreditAttribution: AstonVictor at DevBranch commentedComment #21
AstonVictor CreditAttribution: AstonVictor at DevBranch commentedComment #22
cweagansComment #23
jrglasgow CreditAttribution: jrglasgow commentedI have added some code from this ticket to my branch for #3124700: Deprecated Code Report to make it compatible with D9
Comment #24
budalokko CreditAttribution: budalokko commentedClosing as this is solved in 2.0.x-dev branch now, after committing #3124700: Deprecated Code Report.