Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




3 posts

Wannabe Geek


Topic # 24434 24-Jul-2008 06:00
Send private message

Hello all, I'm new, I hope I'm in the right area and appreciate any help that you can provide.

Several years ago I created a website using ASP where teachers and college students could upload lesson plans, power points, hand outs, etc into an Access Database (Access 2003) and then everyone could search for specific subject so they could share resources, everyone was happy.  The site is located at:  http://agsc.tamu.edu/lessonplan/search.asp  I know it looks terrible, that was when I was first learning to build websites.  Anyways, that site resides on a server at Texas A&M, I left Texas five years ago and when they made some changes to the server the site stopped working and no one can upload files.  So, now that I'm in Georgia I built a new and improved version of the old site.  The new one is located at:  http://www.agteacher.com/ .

Texas A&M sent me the Access database from the first site and asked me to add all of those files to the new site.  The problem is that all of the files are stored in the Access database as "Long Binary Data" or BLOB data.  The only way I know to get them out is to go to the old website and right click on each file and save it to my local machine; with over 2000 files this would be a pain in the neck.  The new site uses PHP and a MySQL database where I store the files in a directory and just store the path in the MySQL database. I can move all of the data except for the files by exporting it from Access as a CSV and then import it into the MySQL database, but I really need to figure out a way to automate it, or do a batch process, I don't know, but there has to be a better way to get all of those files out of the Access database and put them into a directory.

I have read and read forums trying to figure this out, I'm really at my wits in.  If this is too complicated to explain for free I would be happy to pay someone to help me with this... I'm just stuck :(  Thanks in advance for any help.

Create new topic
6294 posts

Uber Geek
+1 received by user: 377

Moderator
Trusted
Subscriber

  Reply # 151072 24-Jul-2008 19:20
Send private message

My suggestion would be to write a small ASP script that would grab the file contents out of the BLOB column, and write each file to the filesystem with the ID number of the row it belongs to.  After uploading these files to the server, you should be able to rename them to prevent people accessing them by increasing the filenumber they are currently looking at.

Is each file type the same? ie are they all .doc files or .xls files or is there a column in the db that tells you?

Not too hard to implement, if you need help PM me.



3 posts

Wannabe Geek


  Reply # 151132 24-Jul-2008 23:21
Send private message

nate,

Thanks so much for the reply, I've been beating my head against this problem all night and I don't feel like I am any closer.

File Names:  I captured the file names in a corresponding column named "File Name".

File Types:  In the "File Name" column all of the files have the three letter extension included.  There is a mixture of .doc, .ppt, .jpg, .xls, .etc...  There is another column named "Content Type" that has "aplication/msword" or "application/vnd.ms-powerpoint".  I don't really know if the "Content Type" column is important, I don't use it for anything.

I will go ahead and tell you that I am trying to do something that is way beyond my understanding.  I can put the database on a Windows based server, create the database connection, and execute some simple things like have a form where a person can submit a file to add it to the database, but I don't know how to do what you are describing.  Can you share any code that shows how to write an "ASP script that would grab the file contents out of the BLOB column, and write each file to the file system".  That is exactly what I want to do, but I don't know how to create that script and make it run threw all of the records.

Any additional guidance is appreciated; any chance you know where I can find a script to look at as a model?

Thanks again,

 
 
 
 


6294 posts

Uber Geek
+1 received by user: 377

Moderator
Trusted
Subscriber

  Reply # 152233 28-Jul-2008 22:40
Send private message

Are you able to organise me remote access to one of your servers + the database?  Since this is outside your skill set, I'll write the script to extract the files and dump them into a folder for you to do whatever with.

PM me :)



3 posts

Wannabe Geek


  Reply # 152446 29-Jul-2008 16:09
Send private message

Thanks so much for the offer, but I was able to figure it out with help.  The code posted at http://support.microsoft.com/kb/103257 is close to what I needed and from there a friend worked it out for me.

Thanks.

Jason

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

UFB connections pass 460,000
Posted 11-Dec-2017 11:26


The Warehouse Group to adopt IBM Cloud to support digital transformation
Posted 11-Dec-2017 11:22


Dimension Data peeks into digital business 2018
Posted 11-Dec-2017 10:55


2018 Cyber Security Predictions
Posted 7-Dec-2017 14:55


Global Govtech Accelerator to drive public sector innovation in Wellington
Posted 7-Dec-2017 11:21


Stuff Pix media strategy a new direction
Posted 7-Dec-2017 09:37


Digital transformation is dead
Posted 7-Dec-2017 09:31


Fake news and cyber security
Posted 7-Dec-2017 09:27


Dimension Data New Zealand strengthens cybersecurity practice
Posted 5-Dec-2017 20:27


Epson NZ launches new Expression Premium Photo range
Posted 5-Dec-2017 20:26


Eventbrite and Twickets launch integration partnership in Australia and New Zealand
Posted 5-Dec-2017 20:23


New Fujifilm macro lens lands in New Zealand
Posted 5-Dec-2017 20:16


Cyber security not being taken seriously enough
Posted 5-Dec-2017 20:13


Sony commences Android 8.0 Oreo rollout in New Zealand
Posted 5-Dec-2017 20:08


Revera partners with Nyriad to deliver blockchain pilot to NZ Government
Posted 5-Dec-2017 20:01



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.