Verify HTTP file transfer

Posted on 2012-08-21
Last Modified: 2012-08-27
Here is the problem I am trying to solve.  I have a computer (actually it is a piece of medical equipment running windows 7 and does have access to internet explorer.)  This computer is creating a large data file that is many megabytes in size (sometimes over a few hundred MB.)

Because it is considered medical equipment, I can't load software onto the computer.  What I need to do is write a web application that does a file upload. That part is pretty easy.  Create the form, upload the file and handle the transfer and saving of the file on the server.

The part that I can't figure out is how can I (from within the html page /web browser) do a checksum on the file as it is on the computer hard drive so that I can compare it to a checksum on the same file once it is uploaded and stored on the server?  Because it is patient-related data that is subject to data retention policies, accessibility for legal and future medical needs, etc.  I need to be 100% certain the file was not corrupted during the transfer.  Given the quality of the data connections in various hospitals, there could be problems.

Any ideas would be appreciated...
Question by:Scott Madeira
    LVL 14

    Expert Comment

    Have you ever used wget?  Can be used to download files / entire websites using port 80.

    It may or may not work in your situation but check it out.  You can check the md5 checksum of the file download with it.
    LVL 10

    Accepted Solution

    If you want to compute the checksum of the file on the medical device, you will need software on the device that can read the file. Since you cannot "install" software on the device, you will need an alternate mechanism to get executable code on the device. For example, if the device trusts the digital signature of a signed Java applet, that applet could compute the checksum.

    If that's not possible then you will have to rely on the transport layer of the network connection to ensure a good transfer. (There is a checksum computed and verified on every network packet.) Where you might run into problems is if the connection is interrupted and you get a partial transfer. You can mitigate against partial transfers by having a two-step process: step 1. upload the file; step 2. confirm the upload. If the connection is interrupted during step 1 then step 2 cannot occur.
    LVL 10

    Expert Comment

    dmwynne, the medical device is an HTTP client; wget downloads files from an HTTP server.
    LVL 14

    Author Closing Comment

    by:Scott Madeira
    Thanks for the pointer.  I will look into using the Java applet to compute the local checksum prior to the upload.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now