File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Languages and the fly likes how to upload an audio file into MySql using SQL command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "how to upload an audio file into MySql using SQL command" Watch "how to upload an audio file into MySql using SQL command" New topic
Author

how to upload an audio file into MySql using SQL command

utsav gupta
Ranch Hand

Joined: Mar 19, 2009
Posts: 57
Hi

I have an audio file which I want to insert into a database using plain sql command. How do I do that?
I know its not a good idea to do that but the audio files are very small (hardly few kbs)
I understand that the files have to be converted into a binary stream and inserted in the form of BLOB but how do i do that is there an inbuilt function in MySQL to convert the file into BLOB?
I cannot use java or any other programming language just sql and windows batch commands.

Please reply.

Thanks
Utsav.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

A simple search ...

INSERT INTO blob_tabl (some_col) values(load_file('/path/to/file'));

WP
utsav gupta
Ranch Hand

Joined: Mar 19, 2009
Posts: 57
wow!

I wonder how did i miss that in google!

Thank You William!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to upload an audio file into MySql using SQL command