Plankton has asked for the wisdom of the Perl Monks concerning the following question:

Friends,

I have been off in Java land (J2EE & J2EE 1.4 Application Server ( formerly Sun ONE Application Server ) and Tomcat) trying to figure out how to upload large files (maybe up to a Gigabyte) via https and implementing form-based authentication. I found that implementing form-base authentication was really easy on J2EE 1.4 Application Server at least. But I can't get large files to upload without "Read timed out" exceptions. I am thinking about chucking the idea of using Java for this ... I suspect that there is a mod_perl way of doing these things that a really easy to use. I am right? Can a helpful monk point me to some example?

Plankton: 1% Evil, 99% Hot Gas.
  • Comment on form-based authentication large file uploads?

Replies are listed 'Best First'.
Re: form-based authentication large file uploads?
by Anonymous Monk on Feb 27, 2004 at 13:11 UTC
    well... this is actually not a java problem since you probably just have to change your timeout settings.
      Which timeout settings? Specifically ,what J2EE 1.4 Application Server settings ... but we maybe getting way off topic here. What I was wondering if any monks have done something like this with mod_perl? Or CGI even?

      Plankton: 1% Evil, 99% Hot Gas.
Re: form-based authentication large file uploads?
by Anonymous Monk on Feb 27, 2004 at 09:54 UTC

    My only suggestion is to not use HTTP for such large files. HTTP isn't a good protocol for throwing gigabytes of data around. I would look into something like FTP to handle this.

      I can't use ftp because I have a requirment to encrypt the data while it is being transmitted (ala. SSL). I currently use SSH but this has the problem having to provide shell access.

      Plankton: 1% Evil, 99% Hot Gas.
Re: form-based authentication large file uploads?
by crabbdean (Pilgrim) on Feb 27, 2004 at 17:21 UTC
    You should be able to open a socket connection (all types are supported) and then stream the data using an encryption module.

    For socket connections check out the IO::Socket or Socket modules. Also read the perlipc manual page for Perl Interprocess Communication.

    For encryption check out one of the many "Crypt::" modules. I found the best way to check them out was to run the "ppm3" package manager from the command line and then search ("s crypt") for crypt modules, install them and read them. There are many variations and encryptions levels, some government standard. Some allow for fragmented streaming that then piece it all back together on the other end.

    I've also downloaded a few quick tutorials on how to write sockets, which are a great kickstart. I'll have to dig them up. Email me if you want a copy. Also you can't go past the invaluable article An Advanced 4_4BSD Interprocess Communication Tutorial Its written for C but gives you the principles for sockets

    Not sure about the form authentication side of things but I hope that helps with the encrypted data via http problem side of it

    Dean
    crabbdean at yahoo.com.au