The file_check_upload function is a bit misleading, in that not only does it 'check' an upload to ensure a file is valid, it also transfers the contents of the $_FILES array into an object which upload.module then processes. When reading the code it's not immediately obvious that this is what's happening, thus it can be quite confusing trying to figure out at what point this happens.

Here is a patch that attempts to clarify these comments to help explain this better.

CommentFileSizeAuthor
file_check_upload_comments.patch1.36 KBwebchick
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Status: Needs review » Reviewed & tested by the community

I suggested this change (when Junyor asked something). I do remember my confusion when I was trying to understand the upload process. No code change so why not commit it :) ?

Dries’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)