I've tried and tried to get this to work, but is there any way to use drupal_execute to submit a file already on the system to a node with an imagecache field? Nothing is working with the way file_check_uploads works, since the file actually has to be put into $_FILES.
Is there any way to get around this, or any way to make it possible, modifying imagefield.module?
Another option would be to make it not required, and then attach it manually through the database, but that seems more problematic.
Any help is appreciated.
Comments
Comment #1
bradlis7 commentedGiving an alternative route would also be good for attaching images by url (Issue #108737).
Comment #2
bradlis7 commentedFixing title. This still needs a route... right now I'm developing using SQL, which seems like a bad idea, but the only real route to adding files.
Comment #3
dopry commentedAs you notice file_check_upload needs some TLC.... You could try just injecting the data in the session or attaching the data to the imagefield form. I'd look through the prepare hook in imagefield and at the forms and start looking at the form and the session at different parts of the form submission process. I hope it helps get you going in the right direction.
.darrel.
Comment #4
bradlis7 commentedI've got it the bulkupload module working, but as the issue says, the image field cannot be required. I was thinking maybe there could be an additional field (for authorized users) to attach a file already in the files folder, which would allow drupal_execute to work, since it's only using a string.
But honestly, the solution needs to occur in file_get_upload / file_save_upload. I'll probably open up an issue there.
Comment #5
dopry commentedI'm working on file.inc and generic file handling... please post it... I'm planning to change a lot of the fundamentals of drupal file handling if my patches get accepted.
Comment #6
quicksketchMarked 137593 and 136257 as duplicates.
Comment #7
dopry commentedI think your solution should be based on this... http://drupal.org/node/201594