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

bradlis7’s picture

Giving an alternative route would also be good for attaching images by url (Issue #108737).

bradlis7’s picture

Title: Using drupal_execute with imagecache » Using drupal_execute with imagefield

Fixing 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.

dopry’s picture

As 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.

bradlis7’s picture

Status: Active » Postponed

I'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.

dopry’s picture

I'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.

quicksketch’s picture

Marked 137593 and 136257 as duplicates.

dopry’s picture

Status: Postponed » Closed (fixed)

I think your solution should be based on this... http://drupal.org/node/201594