Error: Could not fetch http://thedevnet.com/wp-content/plugins/gd-star-rating/css/gdsr.css.php?t=0&s=a10i10m20k20c05r05%23121620243046%23121620243240%23s1pchristmas%23s1pcrystal%23s1pdarkness%23s1poxygen%23s1goxygen_gif%23s1pplain%23s1ppumpkin%23s1psoft%23s1pstarrating%23s1pstarscape%23t1pclassical%23t1pstarrating%23t1gstarrating_gif&ver=1.7.2 for caching. You might need to exclude this file in WP Minify options. The Developer Network – Multiple File Uploading With PHP

Multiple File Uploading With PHP

This script takes care of the common problem of getting lots of files up to your server. Your traditional form uploader does not handle multiple file uploads and forces you painfully to process each upload individually. Using this Flash and jQuery based uploader you can shift select a whole bunch of files and upload them at the same time with progress bars! How cool is that? Well this is one of those things that you have to try out for yourself.

Preview:

preview

Step 1 (create a common include [_common.jSwfUploader.php]):

  1. <?
  2.  // shared by both both the client and the uploader
  3.  // http://thedevnet.com/php/classes/multiple-file-uploading-with-php/
  4.  // include class
  5.  require_once('_class.jSwfUploader.php');
  6.  // create object
  7.  $multiUpload = new multiUploader();
  8.  
  9.  // change any default variables here:
  10.  $multiUpload->file_size_limit = 2024; // 2024 KB
  11. ?>

view more variables...

Step 2 (your basic upload client):

  1. <?
  2.  // http://thedevnet.com/php/classes/multiple-file-uploading-with-php/
  3.  include_once('_common.jSwfUploader.php');
  4. ?>
  5. <html>
  6. <head>
  7.  <title>My Test jQuery SWF Multiple File Uploads Using PHP</title>
  8.  <link href="jSWFUpload.css" rel="stylesheet" type="text/css" />
  9.  <? $multiUpload->headjs() ?>
  10. </head>
  11.  
  12. <body>
  13.  <? $multiUpload->fileform() ?>
  14. </body>
  15. </html>

Step 3 (your basic upload handler):

  1. <?php
  2.  require_once('_common.jSwfUploader.php');
  3.  
  4.  $uploaddir   = $multiUpload->uploaddir;
  5.  $maxfilesize = $multiUpload->file_size_limit;
  6.  $filepostname= $multiUpload->file_post_name;
  7.  
  8.  
  9.  $file = $uploaddir . basename($_FILES[$filepostname]['name']);
  10.  $size=$_FILES[$filepostname]['size'];
  11.  
  12.  if($size>maxfilesize*1024)
  13.  {
  14.   echo "error file size > max allowed size";
  15.   unlink($_FILES[$filepostname]['tmp_name']);
  16.   exit;
  17.  }
  18.  if (move_uploaded_file($_FILES[$filepostname]['tmp_name'], $file)) {
  19.    echo "success";
  20.  } else {
  21.   echo "error ".$_FILES[$filepostname]['error']." — ".$_FILES[$filepostname]['tmp_name']." %%% ".$file."($size)";
  22.  }
  23. ?>
jQuery PHP Flash Multiple File Uploader with Wrapper
jQuery-SWFUpload_PHP_Wrapper.zip
Version: 1

88.2 KiB
153 Downloads
Details…

GD Star Rating
loading...

Originally posted 2009-10-21 04:28:16.

Popularity: 100%

Posted by irbobo   @   2 September 2010

Related Posts

Like this post? Share it!

RSS Digg Twitter StumbleUpon Delicious Technorati Facebook

1 Comments

Comments
Oct 23, 2009
5:56 pm
#1 irbobo :

I don’t even know where to begin to elate how awesome this script is. Really does some amazing stuff.

GD Star Rating
loading...
Leave a Comment

You must be logged in to post a comment.

Previous Post
« Send SMS by Email.
Next Post
Powered by Wordpress   |   Lunated designed by ZenVerse