Hi!

It could be useful to be able to add files to the files table in profiler. This is useful when you for instance create a demonstration installation profile and want to have populate filefields with images.

Here's a patch that adds the possibility to add files. I added the component install to system since the files table is created by the system module.

I set the weight to 9 so that the files are inserted before nodes, so that they can refer to them later.

It's currently required to specify the file mime type, since you currently need the fileinfo pecl package installed to guess the file mime type from a file.

CommentFileSizeAuthor
profiler-install-files.patch1.38 KBfabsor

Comments

q0rban’s picture

Status: Needs review » Closed (duplicate)

I think this is a duplicate of #994890: Handle filefields/imagefields in node creation, even though that says imagefield. :)

dixon_’s picture

Thanks! Patch is cross posted to #994890: Handle filefields/imagefields in node creation as I think this is a much more generic and simpler approach to the same problem.