views:

272

answers:

2

I am looking to upload files into a MySQL database using a drag and drop application. Any ideas?

I want to be able to drag a file into the browser and then type in a file name.

THANKS!

A: 

The Java Jump Loader will allow you to drag files into your browser. Getting them referenced in a MySQL table will be a different job though. You'll have to run that query from the server-side.

The Jump Loader documentation even has code examples demonstrating how to move the file once it's uploaded to your permanent location. Inserting the file-reference into the database is a breeze from there.

Essentially, you'll just run an INSERT query containing the filepath:

$sql = "INSERT INTO files(filepath) VALUES('%s')";
$rst = mysql_query( sprintf($sql, $filepath) ) or die( mysql_error() );

And if you need to you can spit out the newly created ID:

print mysql_insert_id();

For a demo of drag-and-drop uploading, visit http://jumploader.com/demo_embedded.html

Jonathan Sampson
A: 

How about Rad Upload http://www.radinks.com/upload/

e4c5
Link is broken.
Jonathan Sampson
sorry server restart
e4c5