On 12 Jun 2001, David N. Welton wrote:
> Wojciech Kocjan <[EMAIL PROTECTED]> writes:
> > 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.

I know what field I'm looking for, but not the index in the
$UPLOAD() lists... That's what bothers me and what's easier in PHP/AOL...

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

Probably a better thing :> Also, method of getting the data should be set
by the script. Ie

set fh [upload get -name $name -method channel]
or
set data [upload get -name $name -method result] (after all, I'll get it
in the result, not set a variable ;-)

Also, here's what imho could prove useful - at least for me.
upload save -name $name -file [file join $files $id.jpg]

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

I remember writing JPEG uploads and the image wasn't fine...

Could you put the Tcl script to save the file?

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

I agree, but in current implementation it's easier to use files and then
read it to a variable... At least it was for me :-)

After a small reconsideration, it'd be a lot better to allow multiple
methods of getting the file - variable,channel and save. The last one
could prove useful in e-drive like solutions.

--
Wojtek Kocjan
[EMAIL PROTECTED]



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

Reply via email to