RE: Large/unreliable file uploading over HTTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Jason Pruim [mailto:japruim@xxxxxxxxxx]
> Sent: Monday, September 08, 2008 10:48 AM
> To: Boyd, Todd M.
> Cc: php-general@xxxxxxxxxxxxx; Craige Leeder
> Subject: Re:  Large/unreliable file uploading over HTTP
> 
> 
> On Sep 8, 2008, at 11:25 AM, Boyd, Todd M. wrote:
> 
> >> -----Original Message-----
> >> From: Craige Leeder [mailto:cleeder@xxxxxxxxx]
> >> Sent: Monday, September 08, 2008 8:49 AM
> >> To: mike
> >> Cc: PHP General list
> >> Subject: Re:  Large/unreliable file uploading over HTTP
> >>
> >> The only concern I would have is that you are using a third party
> >> software/applet to do these uploads. I'm not a fan of MAKING users
> >> have
> >> a piece of software enabled to allow them basic web-standard
> >> functionality on a site.
> >>
> >> It is however, an interesting concept. It would really come in
handy
> >> for
> >> extremely large files.
> >>
> >> - Craige
> >>
> >> mike wrote:
> >>> Let's face it - HTTP is not very good for file uploads. It's
> >> stateless
> >>> nature, slow connections, inability to resume (technically), etc,
> >> etc.
> >>>
> >>> What I've been thinking about is a way to skip all the normal
> >>> annoyances with file uploading - multipart form encodings, file
> >> upload
> >>> tools with specific needs, PUT vs POST, connection resets, ... the
> >>> list goes on and on.
> >
> > ---8<--- snip!
> >
> >>> I can't think of any method to do it in-browser, but doing it this
> >> way
> >>> could open the gates for things like Google Gears to possibly work
> >>> too...
> >
> > I have an "almost-fully-functional" Java Applet file uploader.
> > Progress bar, unlimited* file size, blah blah blah... can hook into
> > nearly any language on the other end (though I'm currently working
> > with PHP). Some bytes are missing from the resulting file when I try
> > to upload an MP3, but it's a work in progress.
> >
> > I don't see the problem with using a Java Applet or something that
> > is easily installed on-demand. Java doesn't quite have the
> > widespread adoption I would hope for, but it definitely makes its'
> > way around.
> 
> Hey Todd,
> 
> This sounds exactly like what my day job needs... I just took over the
> website, and currently they have it where people have to ftp the file
> into their server to get large files, and with them being a print
> shop... A couple gigs per job is not unheard of.
> 
> If there is anything that I can do to help get that finished up let me
> know! :)

Jason,

I'd be more than happy to spread the source around. Files of any size
are not a problem... the Applet breaks a file into (I believe) 512kb
chunks for transfer. The first POST to PHP tells PHP how many chunks and
some other identifying information. Each POST after that is a 512k chunk
of the file. These files are then strung back together after the last
chunk is uploaded.

I probably need to do some hash checking to ensure that files have, in
fact, uploaded (and uploaded completely)... but for testing on my local
machine, I didn't bother (yet). The problem is that a few bytes
(depending on the size of the file--and therefore, the number of chunks)
are missing from the uploaded file. This makes MP3s sound like they were
recorded underwater, and text files miss a letter every now and again.

I'll dig through the code I have for it when I get home from work this
evening. To be honest, I haven't poked around it for some time now--a
month, perhaps?--and it might take me a day or two to make sense of it
all again. :)

Anyway, I'll e-mail you what I've got so far and see what you can make
of it. I had begun to find a pattern in the missing information with a
"Diff"-like text editor and a notepad (yes, the physical kind made of
paper :D), but I was forced to abandon it for "real" work as the
uploader is a side project of mine.

If anybody else is interested in the PHP/Java Applet source, I am glad
to share it. I started working on it myself for a friend's website when
I discovered that people are actually charging money for software
packages that accomplish this (seemingly) simple process.


Todd Boyd
Web Programmer




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux