Jump to content

Storing Files in DB? Tracking versions?


doni49

Recommended Posts

I'm interested in storing a file in  MySQL db.  I'd also like to be able to compare the original file and an updated file and pull out JUST THE UPDATES and store the updates under a separate record.

 

Is there simple way of doing this?  I'm imagining that it wouldn't be too difficult if the file were plain old text file but a large majority of the files that I need to do store are binary.

 

Last but not least--is there a way that PHP can tell if the file is binary or ascii (so that it can be stored in the properly formatted db field)?

Link to comment
https://forums.phpfreaks.com/topic/97542-storing-files-in-db-tracking-versions/
Share on other sites

I'm interested in storing a file in a MySQL db.

 

P.S. I just realized that it almost sounds like I just wanted to store ONE file.  I wanted to be sure that I was clear on this--I'm not talking about just one file.  I want to build a system that will backup all the files on our server--saving different versions.  But I'd like to avoid saving data that hasn't changed in a new record.

 

So I hoped to be able to store the original file and then do comparison and pull out any portions that have changed and store the changes in separate records.

 

Clicking on version 2 for example, would cause the restore script to take the original version and read to the first change point, insert the update and then continue with the original from the end of the change point.

 

Restoring an entire folder would cause the script to re-build the latest version of each file in the folder and save that to the folder.

 

Thx again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.