[Clipart] upload script problem?
Jonadab the Unsightly One
jonadab at bright.net
Tue Mar 29 06:45:38 PST 2005
"Stephen Silver" <ocalocal at btinternet.com> writes:
> It wouldn't make any difference, as you would still get the same
> conversion from codepage-1252 to UTF-8.
I'm not clear on why that conversion happens.
>> This bug may have to wait for the charset issues to be sorted out
>> in general.
>
> That won't solve the problem for binary files, as there's still the
> truncation issue.
Oh, is there more going on than just charset trouble anyway?
>> unless we decide to store the file on the server ad interim and
>> send the browser a cookie that refers to it, which would also save
>> bandwidth
>
> Storing the file on the server has to be the best way. You don't
> necessarily need cookies for this, as you could put the filename
> in the upload form.
Same difference. (I guess I wasn't clear; I meant "cookie" here not
in the W3C sense per se (although that would be an example) but in
general sense of a magic token. The "cookie" could be a random
alphanumeric string that could also be used as the filename, for
instance, and yeah, it doesn't matter how we get the browser to send
it back to us, so it could indeed just be a hidden field.)
>> but create other issues.
>
> I don't see any major issues with this, although I could be missing
> something. Discarded files will end up cluttering the server, but
> if they are kept in a separate directory they can easily be cleaned
> off every now and then.
That's the main issue, and yeah, it's a temp directory, so I guess
it's not that big a deal. It does save bandwidth and improve latency
on subsequent form submissions, especially for large binary files.
Okay, I think I'm convinced of that.
Come to think of it, that's *basically* what we were doing before,
with CGI::Lite, only the module was storing the files for us, and we
were just reading them out. I just looked in the temp directory, and
there are files in it dating all the way back to December. We should
clean that up from time to time. What's the easiest *nix command to
delete files older than (say) one month, in a given directory? I
should know this, but I don't.
--
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/
More information about the clipart
mailing list