Files and Checksums

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob

    #1

    Files and Checksums

    Good afternoon,

    Is it possible to have JavaScript do a checksum of a file a user has
    chosen to upload via a multipart html form? I'd like have JavaScript
    do a checksum on the client side, embedded the result in the form, and
    then have a CGI on the server check to ensure the server-side checksum
    matches the client. Is such a thing even possible?

    Thanks in advance for any advice.

    Rob
  • Jim Dabell

    #2
    Re: Files and Checksums

    Rob wrote:
    [color=blue]
    > Is it possible to have JavaScript do a checksum of a file a user has
    > chosen to upload via a multipart html form? I'd like have JavaScript
    > do a checksum on the client side, embedded the result in the form, and
    > then have a CGI on the server check to ensure the server-side checksum
    > matches the client. Is such a thing even possible?[/color]

    Part of your question is already mentioned in the FAQ:

    <URL:http://jibbering.com/faq/#FAQ4_3>

    Obviously, you'll need access to the filesystem to checksum the file.

    On the other hand, what you describe is already provided for by HTTP. Look
    into the Content-MD5 header:

    <URL:http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec1 4.15>

    I have no idea what browser support for this is like.


    --
    Jim Dabell

    Comment

    Working...