Thank you Alan for coming up with this module, but I can't
really see any big difference between this upload element
and Drupal's file element.
Ok, Drupal's file element does not accept REQUIRED.

If this module is meant for developers only, most developers
would be able to work with Drupal's file element.
I tried using this upload element in the filebrowser module
and later found that Drupal's file element is just as good.
Maybe there are instances where this upload element is
much better than Drupal's file element.

It would be nice if there is a file description element
to accept file description (file metadata) and provide a way
for users to easily create, edit and delete file description.

Thank you.

Comments

Alan D.’s picture

Component: Code » Documentation
Status: Active » Closed (fixed)

I can't really see any big difference between this upload element and Drupal's file element.

The element can be thought of as an advanced file upload element. You can do everything using the file element, it just takes work (a lot of work as I discovered).

There is no need to muck around with doing the custom validation step to actually do the file upload, this is taken care of. To see how this causes the elements to differ (the main reason behind the module), add a file element and another required field to a demo form. Select a file and do not add anything into the required field. Save. The uploaded file is lost during the validation error.

So using the file element, you either force the user to reload the file again or to handle the storage of the element manually, which is the real crux.

tried using this upload element in the filebrowser module

It does not interact with any core Drupal elements, like adding new features, so I am not sure how this relates to Filebrowser module as this module does it's own file handling.

It would be nice if there is a file description element to accept file description (file metadata)

I created this to handle a fairly complex layered panel of images (30 x 50 and 7 layers deep in one instance), and really wanted to automate things as much as possible. Each panel has a number of attributes attached, these were simply added as per the example given in the README.txt. None of these attributes would have any meaning in a normal Drupal site, so by design the upload element was trimmed down to act as a container for any attributes added to it.

So metadata fields are omitted by design, but are really easy to add if desired.

It would make sense to store these extra fields with the {files}.fid associated with the upload, which is also an area that upload element doesn't handle. It's scope of data storage is limited to the core {files} table

cmgui’s picture

Thank you Alan for the reply.
Yes, your module is quite powerful with regards to image upload.