Re: Check File For Change
>>How are you going to guarantee the person that changes the file doesn't change the registered hash too? Easy: don't put the registered hash in the edit form. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:29 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check File For Change
Robert Rawlins - Think Blue wrote: > Now, I'm looking for a method to ensure that the file has not been modified > on the file system since the user uploaded it, the chances of it being > modified are exceptionally slim, I know, but the consequences of it having > happened are quite serious, so I need to be sure. > > I'm thinking about implementing some form of MD5 check sum on the files, > this sum will be saved to the database when the file is uploaded, and > checked against a newly generated checksum before the file is served back to > the user again. Does that sounds like a fair concept? How are you going to guarantee the person that changes the file doesn't change the registered hash too? Jochem ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291077 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Check File For Change
The inbuilt Java crc32 code might work well too: http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/CRC32.html On 10/15/07, Claude Schneegans <[EMAIL PROTECTED]> wrote: > >>Even if the tag is not > published I'd love to hear a little about the concepts of how it works, you > can mail me off list if you'd prefer to keep it private. > > Actually, it does not use MD5 algorithm, but a CRC-32 checksum, which > returns an 8 characters hexadecimal value. > The probability of having two different files having the same value is > near zero, especially if you consider > only files having the same length. > > It is a C++ tag (Windows only), but much more efficient than using CF code. > I'm sending the tag to you as a beta test. > > -- > ___ > REUSE CODE! Use custom tags; > See http://www.contentbox.com/claude/customtags/tagstore.cfm > (Please send any spam to this address: [EMAIL PROTECTED]) > Thanks. > > > ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291062 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check File For Change
>>Even if the tag is not published I'd love to hear a little about the concepts of how it works, you can mail me off list if you'd prefer to keep it private. Actually, it does not use MD5 algorithm, but a CRC-32 checksum, which returns an 8 characters hexadecimal value. The probability of having two different files having the same value is near zero, especially if you consider only files having the same length. It is a C++ tag (Windows only), but much more efficient than using CF code. I'm sending the tag to you as a beta test. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291039 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Check File For Change
Thanks Claude, That certainly sounds like an excellent idea, I also like the concept about ensuring two files are not the same, just with different file names, this could most certainly play nicely in my application. Even if the tag is not published I'd love to hear a little about the concepts of how it works, you can mail me off list if you'd prefer to keep it private. Thanks again for the advice mate, I'll look into that directory tag too. Rob -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: 14 October 2007 16:45 To: CF-Talk Subject: Re: Check File For Change >>Does that sounds like a fair concept? It sure is. I have written such a tag and it works. I use it to make sure two images are not the same, even if they have different file names. But I have not publish the tag yet. I also have a tag that return a correct time stamp about a file, to the second and consistent over all CF versions, see CFX_ListDir http://www.contentbox.com/claude/customtags/ListDir/viewListDir.cfm -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291037 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Check File For Change
>>Does that sounds like a fair concept? It sure is. I have written such a tag and it works. I use it to make sure two images are not the same, even if they have different file names. But I have not publish the tag yet. I also have a tag that return a correct time stamp about a file, to the second and consistent over all CF versions, see CFX_ListDir http://www.contentbox.com/claude/customtags/ListDir/viewListDir.cfm -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291035 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Check File For Change
Would you be able to compare the date/time of the upload to the date/time of the 'last update' for the file? This could shed some light on whether the file had been opened/re-saved since the upload. (however it would not show if it had been opened and 'not changed', only re-saved. William -- William E. Seiter Have you ever read a book that changed your life? Go to: www.winninginthemargins.com Enter passkey: goldengrove Web Developer http://William.Seiter.com -Original Message- From: Robert Rawlins - Think Blue [mailto:[EMAIL PROTECTED] Sent: Saturday, October 13, 2007 10:46 AM To: CF-Talk Subject: Check File For Change Hello Guys, I've got an application that receives files from an upload form, the user can then come and view/download those files again at a later date. When the file is uploaded I store the basic details, such as the files path and name into a database table, these entries are displayed to the user with a download link, once the link is clicked the file is then served to the client using the cfcontent tag. Now, I'm looking for a method to ensure that the file has not been modified on the file system since the user uploaded it, the chances of it being modified are exceptionally slim, I know, but the consequences of it having happened are quite serious, so I need to be sure. I'm thinking about implementing some form of MD5 check sum on the files, this sum will be saved to the database when the file is uploaded, and checked against a newly generated checksum before the file is served back to the user again. Does that sounds like a fair concept? How severally is it likely to hit performance? Is there a better option? I've also not done any of this MD5 work before, has anyone got any pointers on the best way to handle it? Thanks again, Rob ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291016 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4