I think I found a really cool JQuery file upload plugin but it seems they do not have a PHP server side example and I'm a little overwhelmed on how to set it up.
Can you kindly help me out and show me how to use it?
Here's the link to their page:
I think I found a really cool JQuery file upload plugin but it seems they do not have a PHP server side example and I'm a little overwhelmed on how to set it up.
Can you kindly help me out and show me how to use it?
Here's the link to their page:
I don't know the plugin, but basically you need to set an URL where the files should be "sent" to (take a look at the example.html file on github):
$("#upload_field").html5_upload({
url: /*PATH TO PHP FILE.php*/,
...
The PHP file depends on what you want to do: Store the files in a database, store them on the server... However, if you want to store them in a folder, take a look at this code I used in a HTML5 file uploader:
//Count files
$count = count($_FILES['file']['name']);
for($i = 0; $i < $count; $i++){
//Path
$filepath = 'upload/'.basename($_FILES['file']['name'][$i]);
//Save file
move_uploaded_file($_FILES['file']['tmp_name'][$i], $filepath);
}
It's very basic, it doesn't check for errors, file types and things like that. Remember to adjust the input name: $_FILES['INPUT NAME HERE'][.....
I was looking at jquery-html5-upload, but it is still very young, low documentation and demos, no server side demo, etc...!
On the other hand, here's a good tutorial to get you on the right track with HTML5 and Jquery for File Uploads:
Tutorial :: html5-file-upload-jquery-php
and my personal favorite: jQuery-File-Upload
Ps:
Place a request on the jquery-html5-upload for the author include a server side example.