Re: How to capture origional client machine _directory_ and file name on uploads?

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

 



On Mon, Oct 6, 2008 at 11:48 AM, J. Hill <jh@xxxxxxxxxxx> wrote:
> This should be trivial, but apparently not -- or maybe I just need more
> caffeine. My searches have come up empty.
>
> I am trying to get not only the original file name on uploads, but also the
> original directory on the client machine as well.
>
> The purpose is for users who make a mistake on another part of the form;
> when the form is returned for them to complete properly, all of the correct
> values are automatically filled in. That's trivial in most instances, but
> I'm not finding a solution for file uploads.
>
> This seems like a common need. Any suggestions?
>
> Thanks in advance,
>
> Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The file upload will only exist in the specified temp directory for
the request.  So if you redisplay the form you're going to have to
deal with making the file persist yourself.

You can use move_uploaded_file into a temp staging area (so it
persists beyond the original request) along with a session value to
keep track of it until the form has been successfully completed.  But
then you've got to deal with cleaning it up if the user bails out,
uploads a different file, etc.  I'm lazy and just make them re-upload
it since most clients I deal with are on broadband.

-- 
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