It is currently 21 April 2025, 18:41 Advanced search

Import Images into DB

Questions and answers on how to best use Instant Developer

Import Images into DB

Postby asawyer13 » 2 August 2013, 14:00

I have 300-400 image files that I would like to import into my MySQL database to use in in.de.

I believe in.de has a special way that it can save images, etc in the database so that in.de knows what the original extension was.

Would someone have and be willing to share a procedure or small script that would read thru a directory and load the images into database records?

I might be able to do it myself, but I'm thinking if it already exists, it would probably be easier.

Thanks in advance,
Alan
asawyer13
 
Posts: 137
Joined: 10 July 2013, 9:44

Re: Import Images into DB

Postby john w » 2 August 2013, 14:17

Just curious are you looking to load the actual image into the db (blob) or the file path to it.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Import Images into DB

Postby asawyer13 » 2 August 2013, 14:49

File into a blob.
asawyer13
 
Posts: 137
Joined: 10 July 2013, 9:44

Re: Import Images into DB

Postby v.marino » 5 August 2013, 15:37

Here is a simple procedure that loads all the files found in the "temp" directory to the Picture field of the Customers table.

For further details, you could take a look at the following articles:
LoadBlobFile: http://doc.instantdeveloper.com/eng/?ARTID=6C8CD1AC-03FF-4013-95A2-1126C28ABDE8
ReadDirectory: http://doc.instantdeveloper.com/eng/?ARTID=EF2BBCD1-51DB-11D5-91F3-F44534000000
Attachments
loadBlobDB.png
loadBlobDB.png (12.49 KiB) Viewed 6983 times
User avatar
v.marino
Pro Gamma
Pro Gamma
 
Posts: 652
Joined: 2 January 2013, 8:11

Re: Import Images into DB

Postby asawyer13 » 5 August 2013, 16:16

Thanks so much. I will take a look at it tonight.
Alan
asawyer13
 
Posts: 137
Joined: 10 July 2013, 9:44


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 23 guests

cron