[development] Better documentation for working with uploaded files?
andrew morton
drewish at katherinehouse.com
Fri Jul 13 00:10:44 UTC 2007
On 7/12/07, Richard Morse <remorse at partners.org> wrote:
> Hi! Is there a better source for documentation on how to work with
> uploaded files than http://drupal.org/node/111782 [the handbook's
> page]? The list of function for working with files on api.drupal.org
> is not particularly helpful, and the handbook page is also rather
> sparse.
Did you look at the example module:
http://cvs.drupal.org/viewcvs/drupal/contributions/docs/developer/examples/fileupload.module?rev=1.6&view=markup
> Specifically, I want to have users upload seven files (all of which
> must be there), and then save them in a directory *which may not be a
> subdirectory of the Drupal files directory*. Also, I don't want
> Drupal's file upload size restrictions to apply for this one use.
>
> Or, in this case, would it make sense to just ignore the Drupal file
> functions and use $_FILES and the php file handling code directly?
> Would this adversely affect the FormAPI stuff? Would I be able to
> use a _validate function if I'm not using the Drupal file handling
> functions?
You can do it that way but you'll find that as obtuse as they may be,
Drupal's file functions are there to help prevent security exploits.
I'd be very careful doing it by hand.
andrew
More information about the development
mailing list