HTML:
<input type="file" value="choose file" name="file[]" multiple="multiple"/><br/>
<input type="submit" class="submit" value="confirm" />
<input type="hidden" name="uploadFiles" />
</form>
PHP:
if (isset($_POST['uploadFiles'])) {
$fileCount = count($_FILES["file"]["name"]);
for ($i = 0 ; $i < $fileCount ; $i++ ) {
checking......
move_uploaded_file($_FILES["file"]["tmp_name"][$i],$fileName);
}
}
Currently I am using the above way to upload the files, I found that the Jquery UI provide the progress bar function but I have to provide the upload status to it. Therefore, what approach I can choose to get the status?
My recommendation is to download an already built ajax files upload script and study it a bit as they are quite complex to paste as a reply.
I just had a look at my scripts and it seems that the progress it's actually on the JS side, not in the php.
If you have upgraded to php 5.4 you can use
http://www.php.net/manual/en/session.upload-progress.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With