Wojciech Kocjan <[EMAIL PROTECTED]> writes:

> 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

No, you should know this at run time.

> 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

Maybe a command is the right way to go here, too.

> 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:

I have tested it with binary files and it works fine...

> 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.

Uploading to variables is convenient in many cases, and keeps you from
having to do stuff twice - save the file to disk, load the file,
manipulate the file, save the file to disk...

-- 
David N. Welton
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/
         Work: http://www.innominate.com/

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

Reply via email to