Passing file name to other php

Last post 10-12-2011, 7:11 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  10-11-2011, 10:52 AM 70344

    Passing file name to other php

    I have the uploader portion working fine but I'm trying to get the filename(s) passed to my post form
     
    <form action="./upload.php" id="form1" method="POST">
     
    then in my upload.php would like to do something like
     <img src='http://mywebsite/uploads/<?php echo $_POST["processedlist"]; ?>
     
    But that doesn't work gives me the GUI names all combined how can I get individual file names passed and how handle multiple?
  •  10-12-2011, 7:11 AM 70357 in reply to 70344

    Re: Passing file name to other php

    Hi sschuaer513,
     
    Please open example page "form-keepingstate.php" , it shows you how to get the actual upload file name.
     
    The section below
     
    if(count($files)>0)
    {
        echo("<table style='border-collapse: collapse' class='Grid' border='0' cellspacing='0' cellpadding='2'>");
        foreach($files as $mvcfile)
        {
            echo("<tr>");
            echo("<td>");echo("<img src='phpuploader/resources/circle.png' border='0' />");echo("</td>");
            echo("<td>");echo($mvcfile->FileName);echo("</td>");
            echo("<td>");echo($mvcfile->FileSize);echo("</td>");
            echo("</tr>");
            
            //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();
        }
        echo("</table>");
    }
     
    Regards,
     
    Ken
View as RSS news feed in XML