Hi.

I've been wondering on the upload mechanism in mod_dtcl.

I was wondering if it could be possible to rewrite part of it to work like
in PHP and AOLserver (which proves to be more useful).

Currently if I want to get uploaded file, I need to:
1. find entry's name in UPLOAD(name)
2. check if it's uploaded to variable or channel
3. if it's uploaded to a channel, then I have to set translation to binary
and read it
4. if it's in a VAR, i have to copy the n-th argument from UPLOAD(data).

First of all, it's a bit messy.

The way I'd like to see it it:
UPLOAD(names) - a list of uploaded files
UPLOAD($name.filename) - filename on remote host
UPLOAD($name.size) - size in bytes (octets ;-)
UPLOAD($name.type) - mime type (optional)
UPLOAD($name.channel) - channel for that uploaded file

Also, I'd remove Dtcl_UploadFilesToVar and variable uploading code since
it does not work well with binary files (at least for me). I suppose
putting a simple procedure to read&return the data would do, and actually
it could be done with 2 lines:

fconfigure $UPLOAD($name.channel) -translation binaryl
set data [read $UPLOAD($name.channel)]

Imho uploading to a variable only produces a mess and searching for
a name and using the list is a bit of a mess as well... Shouldn't be that
hard to reimplement imho - only using a tmpbuffer+snprintf() to set the
variable's name.

Any comments on that? Should be a lot simplier - especially with forms
involving uploading many files...

--
Wojtek Kocjan
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to