> > However, apreq, IMO, suffers from the same drawback many upload
> > handling APIs do -- the application only gets access to the file
> > once it is fully uploaded. This opens the server to DoS attacks and
> > others.
> There is an upload callback which I added to the code to be able to
> upload to Tcl variables. It could probably be exanded to do more...
Great to hear that ;-)
> > For example, if I only expect JPEG files, I can stop the upload of
> > something else after the first 512 bytes...
> I am going to add an 'upload' command to dtcl, which I will try and
> make as flexible as possible.
Great to hear that one too. I suppose a good and flexible solution is to
use regexp.
ie.
upload -method file -name $myfile -bcheck 16 -bregexp {......JFIF} - this
one could be a bit hard to do but should be quite useful. Also if you code
it well, the regexp checking could be easily converted to using Tcl proc
as well - but I'd really prefer using 1-line regexp ;-).
Maybe a good compromise would be to be able to do sth like in event/bind:
upload -method file -name $myfile -bcheck 256 \
-bregexp [list myregexp {......JFIF}]
and
proc myregexp {pattern data} {
}
It would be really useful, I suppose. Also, the proc could return 0/1
values and a 0 value should simply abor the upload. Maybe it should return
a message to send to the user client in the HTTP header).
Any ideas/comments on that?
--
Wojtek Kocjan
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]