[Clipart] Ideas for cmdline file upload
Bryce Harrington
bryce at bryceharrington.com
Fri Oct 22 10:54:34 PDT 2004
On Fri, 22 Oct 2004, Jonadab the Unsightly One wrote:
> Bryce Harrington <bryce at bryceharrington.com> writes:
>
> > For instance, we could scp a file up to an incoming directory on the
> > server, then do a SOAP call to cause the server to try to pull that
> > file in from the incoming dir.
> >
> > However, I'm not sure if that's the best approach. It has some
> > flexibility to it, in that the file could be uploaded to incoming by
> > any variety of mechanisms, but it adds an additional step that could
> > incur some security or complexity issues.
> >
> > What do others think? Is there another way to get the SVG file
> > itself up to the server quickly, simply and efficiently?
>
> How about using WWW::Mechanize to send it to upload.cgi ?
Hmm, possibly, although it may add more overhead than using SOAP... Not
sure.
After playing with it a bit I decided that for now I'm just going to use
the built-in SOAP mechanism with the MIME encoding, and see how that
goes. We use that at work and haven't had too much trouble with it.
Implementationally that'll be the simplest solution. I'm not sure if
it'd be the most efficient, but as they always say, Avoid Premature
Optimization. So we can do it like this and see if it's fast enough for
us, and if not, then explore other methods.
Btw, I've pretty much got the authentication stuff licked; I have a
login script that prompts for a password and does an authentication
against the daemon server, then stores a binary signature in a ticket in
your user directory that other scripts can use for auth'd communication
with the server. Plus it has a built-in timeout that we can control, so
it works pretty analogously to how ticket-based web login stuff works.
Next I need to do some work on the server side, to wrap up the code into
a module, that I'll contribute to CPAN as WebService::TicketAuth, and
then derive a subclass for OCAL that overrides the is_valid() routine to
do a validation against our Mantis database.
Bryce
More information about the clipart
mailing list