Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Modify The Uplodify
  • Hello,

    Hope someone can help me with this.

    I have the uploadify up and running and everything is going fine.

    Here is what i want, I do not want to start uploading automatically. I want them to add more than one file at a time and then they can decide to X one out in case they put it by mistake.

    So a multiple file uploading but i want them to see a list just like a Single Upload at the bottom on the Demo Page here.

    I have been trying to play around with the script but no can do, its not working for me.

    I have tried to make the auto upload "false" in the script but I need to add the Upload Files (link) and (Clear Files).

    Can anyone help please?

    Thank you

    Fitim.
  • Also would it be possible to add an email notification when someone uploads something?

    Thanks

    Fitim
  • KaPPa said:
    Also would it be possible to add an email notification when someone uploads something?

    Thanks

    Fitim


    Just figured it out. See the code below.

    # page with uploadify

    <script type=\"text/javascript\">
    $(document).ready(function()
    {
    var filenames = new Array();
    $(\"#upload_file\").uploadify
    ({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : 'upload.php',
    'fileDataName' : 'upload_file',
    'sizeLimit' : 10000000,
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : 'uploads',
    'buttonText' : 'Browse Files',
    'queueSizeLimit' : 50,
    'fileDesc' : 'Allowed files',
    'fileExt' : '*.jpg; *.png',
    'multi' : true,
    'simUploadLimit' : 6,
    'onError' : function(event, queueID, fileObj, errorObj)
    {
    alert(errorObj.info);
    },
    'onComplete' : function(event, queueID, fileObj, response, data)
    {
    filenames.push(fileObj.name);
    },
    'onAllComplete' : function(event, data)
    {
    var dataString = 'numfiles=' + data.filesUploaded + '&amp;filenames=' + filenames;
    $.ajax
    ({
    type: \"POST\",
    url: \"upload_success.php\",
    data: dataString
    });
    }
    });
    });
    </script>


    # upload_success.php

    $hdridvertyp = \"MIME-Version: 1.0\r\n\";
    $hdridvertyp .= \"Content-Type: text/html; charset=iso-8859-1\r\n\";
    $header = \"From: <youremail@youdomain.com>\r\n\".$hdridvertyp.'X-Mailer: PHP '.phpversion().\"\r\n\";
    $numfiles = $_POST['numfiles'];
    if (is_numeric($numfiles) &amp;&amp; $numfiles > 0)
    {
    $links = '';
    $filenames = $_POST['filenames'];
    $array_filenames = explode(',', $filenames);
    foreach ($array_filenames as $filename)
    {
    $links .= '<a href=\"http://www.yourdomain.com/uploads/'.$filename.'\">'.$filename.'</a><br /><br />';
    }

    $pluralupload = $numfiles > 1 ? 's were' : ' was';
    mail('youremail@yourdomain.com', $numfiles.' file'.$pluralupload.' uploaded', $numfiles.' file'.$pluralupload.' uploaded to the server.<br /><br />'.$links, $header);
    }
  • mmmm this email notification
    doesnt work for me

    is it by anyone else working

    i want this solution to on my website

    Regards

    KV