Re: Form Input Type="File"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2008-11-22 at 07:31 -0600, Stan wrote:
> In both cases the full path appears in the file selection dialog created by
> <input name=\"SELECTEDFILE\" type=\"file\" />.  The only thing the user does
> after selecting the file is click the submit button.  Default.php creates
> the session variable by first
>     unset($_SESSION['thisSelectedFile']);
> and then
>     foreach ($queryString as $key => $value)
>    {
>    switch($key)
>     {
>                 .
>                 .
>                 .
>     case "SELECTEDFILE":
>      $_SESSION['thisSelectedFile'] = $value;
>      break;
>     default:
>      break;
>     }
>    }
> 
> Like I said ... everything is the same ... except the browser being used.
> 
> 
> "Ashley Sheridan" <ash@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:1227359402.3523.10.camel@xxxxxxxxxxxxxxxxxxxxxxxx
> > On Sat, 2008-11-22 at 06:57 -0600, Stan wrote:
> > > Default.php sets a session variable named thisSelectedFile before
> putting
> > > the page designated by the ID (in this case PictureProperties.php) up.
> > > PictureProperties.php is .
> > >
> > >
> > >
> > > <?PHP
> > >
> > >                 session_start();
> > >
> > >                 if (isset($_SESSION["Stan-and-Jeanne"]))
> > >
> > >                                 {
> > >
> > >                                 $thisPageHandle =
> > > $_SESSION['thisPageHandle'];
> > >
> > >                                 $navigation_table =
> > > $_SESSION['navigation_table'];
> > >
> > >                                 echo "<!DOCTYPE HTML PUBLIC
> \"-//W3C//DTD
> > > HTML 4.01 Frameset//EN\" ";
> > >
> > >                                 echo
> > > "\"http://www.w3.org/TR/HTML4.01/frameset.dtd\"\n";;
> > >
> > >                                 echo "<html>\n";
> > >
> > >                                 echo "                <head>\n";
> > >
> > >                                 echo "                      <link
> > > rel=\"stylesheet\" ";
> > >
> > >                                 echo "href=\"frames_style/Default.css\"
> ";
> > >
> > >                                 echo "type=\"text/css\">\n";
> > >
> > >                                 echo "                      <title>" .
> > >
> > >
> > > $navigation_table[$thisPageHandle]["navigateTitle"] .
> > >
> > >
> > > "</title>\n";
> > >
> > >                                 echo "                </head>\n";
> > >
> > >                                 echo "                <body>\n";
> > >
> > >                                 echo "picture file = '" .
> > > $_SESSION['thisSelectedFile'] . "'<br>\n";
> > >
> > >                                 $picture = str_replace("\\\\", "/",
> > > $_SESSION['thisSelectedFile']);
> > >
> > >                                 echo "picture file = '" . $picture .
> > > "'<br>\n";
> > >
> > >                                 $picture =
> > > str_replace("//Nasserver/PicturesMaster", "../pictures", $picture);
> > >
> > >                                 echo "picture file = '" . $picture .
> > > "'<br>\n";
> > >
> > >                                 $im = new imagick($picture);
> > >
> > >                                 $exifArray =
> > > $im->getImageProperties("exif:*");
> > >
> > >                                 foreach ($exifArray as $name =>
> $property)
> > >
> > >                                                 {
> > >
> > >                                     echo "{$name} => {$property}<br
> />\n";
> > >
> > >                                                 }
> > >
> > >                                 echo "                </body>\n";
> > >
> > >                                 echo "</html>";
> > >
> > >                                 }
> > >
> > > ?>
> > >
> > >
> > >
> > > . and results in .
> > >
> > >
> > >
> > > picture file =
> > >
> '\\\\Nasserver\\PicturesMaster\\2004-07-31_Guadalupe_River_rafting_roll-1\\0
> > > 033126-R1-042-19A_20.jpg'
> > > picture file =
> > >
> '//Nasserver/PicturesMaster/2004-07-31_Guadalupe_River_rafting_roll-1/003312
> > > 6-R1-042-19A_20.jpg'
> > > picture file =
> > >
> '../pictures/2004-07-31_Guadalupe_River_rafting_roll-1/0033126-R1-042-19A_20
> > > .jpg'
> > > exif:ColorSpace => 1
> > > exif:ComponentsConfiguration => ...
> > > exif:Compression => 6
> > > exif:DateTime => 2002:09:30 11:11:11
> > >
> > >                 .
> > >
> > >                 .
> > >
> > >                 .
> > >
> > >
> > >
> > > . with IE6 SP1 and .
> > >
> > >
> > >
> > > picture file = '0033126-R1-042-19A_20.jpg'
> > > picture file = '0033126-R1-042-19A_20.jpg'
> > > picture file = '0033126-R1-042-19A_20.jpg'
> > >
> > > Fatal error: Uncaught exception 'ImagickException' with message 'unable
> to
> > > open image `/Stan-and-Jeanne.com/frames/0033126-R1-042-19A_20.jpg': No
> such
> > > file or directory' in
> /Stan-and-Jeanne.com/frames/PictureProperties.php:24
> > > Stack trace: #0 /Stan-and-Jeanne.com/frames/PictureProperties.php(24):
> > > Imagick->__construct('0033126-R1-042-...') #1 {main} thrown in
> > > /Stan-and-Jeanne.com/frames/PictureProperties.php on line 24
> > >
> > >
> > >
> > > . with Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.0.4)
> > > Gecko/2008102920 Firefox/3.0.4.
> > >
> > >
> > >
> > How is the path getting into the session variable? I think that may be
> > where you problem is, because when you echo out the variable in both
> > browsers after the form submission, you are getting different outputs.
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> >
> 
> 
> 
Have you checked to see that the values being passed by the form are the
same in both cases? It seems that IE is the only browser that is passing
the full path (even though all the browsers show it) If in doubt, fall
back to using the filename in the $_FILES array and create the correct
path using that.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux