Need Help !!! Urgent !!

Last post 04-22-2011, 2:07 AM by chintanshah. 3 replies.
Sort Posts: Previous Next
  •  04-21-2011, 2:57 AM 67272

    Need Help !!! Urgent !!

    Need Help !!!   
     
    i want to implement multiple file uploading  by following way, http://phpfileuploader.com/demo/form-manualstart.php.
     
    here is my doubt, can i change the code of uploader.js as it as only octal data.
    if yes then please give me some guidance, if no then can u tell me the way by which i can change the UI of selected files.
     
    thank you in advance !!!
     
    please do reply as soon as possible    
      
    Filed under: , ,
  •  04-21-2011, 8:19 AM 67281 in reply to 67272

    Re: Need Help !!! Urgent !!

    Dear chintanshah,
     
    uploader.js is obfuscated code and it is only available for source code license user. Please refer to the following snippet to change the UI:
     

    <?php require_once "phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>
      Form - Start uploading manually
     </title>
     <link href="demo.css" rel="stylesheet" type="text/css" />
       
     <script type="text/javascript">
     function doStart()
     {
      var uploadobj = document.getElementById('myuploader');
      if (uploadobj.getqueuecount() > 0)
      {
       uploadobj.startupload();
      }
      else
      {
       alert("Please browse files for upload");
      }
     }
     </script> 
    </head>
    <body>
     <div class="demo">    
       <h2>Start uploading manually</h2>
       <p>This sample demonstrates how to start uploading manually after file selection vs automatically.</p>
       <P>Allowed file types: <span style="color:red">jpg, gif, txt, png, zip</span></p>

             <div id="queuediv" style="display: none;">
                <div id="queuedivtablecontainer">
                </div>
                <div style="font-size: larger; padding-left: 100px; margin: 4px;">
                    <a href="#" onclick="cancelalltasks();return false;">Cancel all tasks.</a>
                </div>
            </div>
       <!-- do not need enctype="multipart/form-data" -->
       <form id="form1" method="POST">
       
       
           
           
        <?php    
         $uploader=new PhpUploader();
         $uploader->MaxSizeKB=10240;
         $uploader->Name="myuploader";
         $uploader->InsertText="Select multiple files (Max 10M)";
         $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.txt,*.zip,*.rar"; 
         $uploader->MultipleFilesUpload=true;
         $uploader->ManualStartUpload=true;
         $uploader->Render();
        ?>
        <br /><br /><br />
        <button id="submitbutton" onclick="doStart();return false;">Start Uploading Files</button>

       </form>
       
       <br/><br/><br/>
    <?php
    $fileguidlist=@$_POST["myuploader"];
    if($fileguidlist)
    {
     $guidlist=explode("/",$fileguidlist);
     
     echo("<div style='font-family:Fixedsys;'>");
     echo("Uploaded ");
     echo(count($guidlist));
     echo(" files:");
     echo("</div>");
     echo("<hr/>");
     
     foreach($guidlist as $fileguid)
     {
      $mvcfile=$uploader->GetUploadedFile($fileguid);
      if($mvcfile)
      {
       echo("<div style='font-family:Fixedsys;border-bottom:dashed 1px gray;padding:6px;'>");
       echo("FileName: ");
       echo($mvcfile->FileName);
       echo("<br/>FileSize: ");
       echo($mvcfile->FileSize." b");
     //  echo("<br/>FilePath: ");
     //  echo($mvcfile->FilePath);
       echo("</div>");
       
       //Moves the uploaded file to a new location.
       //$mvcfile->MoveTo("/uploads");
       //Copys the uploaded file to a new location.
       //$mvcfile->CopyTo("/uploads");
       //Deletes this instance.
       //$mvcfile->Delete();
      }
     }
    }
    ?>    
     </div>
     
    <script type="text/javascript">

        var uploader = document.getElementById("myuploader");

        uploader.handlequeueui = myqueueuihandler;

        function myqueueuihandler(list) {

            if (list.length < 2) {

                document.getElementById("queuediv").style.display = "none";

            }

            else {

                document.getElementById("queuediv").style.display = "";

                var container = document.getElementById("queuedivtablecontainer");

                container.innerHTML = "";

     

                var table = document.createElement("table");

                table.style.borderCollapse = "collapse";

                table.cellSpacing = 0;

                table.cellPadding = 4;

                table.border = 1;

                table.borderColor = "darkgreen";

     

                for (var i = 0; i < list.length; i++) {

                    var name = list[i].FileName

                    var size = list[i].FileSize // (or -1)

                    var stat = list[i].Status // Finish|Error|Upload|Queue

                    var func = list[i].Cancel;

                    var row = table.insertRow(-1);

                    row.insertCell(-1).innerHTML = name;

                    var last = row.insertCell(-1);

                    if (stat == "Queue") {

                        var btn = document.createElement("A");

                        btn.href = "BLOCKED SCRIPTvoid(0)";

                        btn.onclick = func;

                        btn.innerHTML = "Cancel";

                        last.appendChild(btn);

                    }

                    else {

                        last.innerHTML = stat;

                    }

                }

                container.appendChild(table);

            }

            return false; //hide the default;

        }

        function cancelalltasks() {

            uploader.cancelall();

        }
     
    </script>
     
    </body>
    </html>

    Thank you for asking
  •  04-21-2011, 11:48 PM 67288 in reply to 67281

    Re: Need Help !!! Urgent !!

    Thanks for the help Eric...
    i'll try this and reply you
    again thnx a lot !!! 
  •  04-22-2011, 2:07 AM 67290 in reply to 67281

    Re: Need Help !!! Urgent !!

    Yes it's working fine
    thnx for the Help !!! 
View as RSS news feed in XML