How to Create an Ajax Style File Uploader
Vagrantradio teach us how to creating a simple Ajax style file uploader using jQuery, Ajax and Php. Something you can easily implement on your site, complete with front and backend validation.
The application we are going to build will use jQuery’s versatility to allow multiple file uploads without refreshing the page or redirecting, complete with front and back end validation to prevent unwanted files being uploaded to your server.
Demo: http://www.vagrantradio.com/demos/file_uploader/index.html
License: License Free
View tutorial: http://www.vagrantradio.com/2009/09/how-to-create-an-ajax-file-uploader.html
4 Comments
Jason
10.23.2009
Thanks for featuring my tutorial Mufti. Keep an eye out, I will be posting more just like it soon.
Jason´s last blog ..Show Your Stuff in Our Flickr Group
mupet
10.24.2009
Hi Jason thanks for visit, Im waiting your next great stuff
fairuz
08.19.2010
can u help how insert all info into mysql db especially i have 2 table : 1st table for user information 2nd table for files attachments, 2 tables related each others because user information tables have 2 columns to retrieve attachments from 2nd tables ( all attachments file info store here…size, type, name , tmp_name).
user_info (table 1 structure)
id(PK)
user name
user_birth
user_attachements (files 1)
user_approval (files 2)..
created
file attachments
id(PK)
name
type
size
temp_name
tq…sorry about my english
fairuz ´s last blog ..Rahmat & Kasih Sayang Allah… -
Mufti Ali
08.19.2010
First, upload attachment files, insert data into attachment table. If attachement files uploaded and attachment data inserted, and then nsert user info into user info table.
< ?php $target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
$sql="insert into attachements (id,name,type,size,temp_name) values('',......)";
if(mysql_query($sql)){
$sql="insert into user_info('id,'attachment_id',....) values('',last_insert_id(),...)";
$query=mysql_query($sql);
}
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} else {
echo "Sorry, there was a problem uploading your file."; } ?>
There are no trackbacks to display at this time.