Re: Upload file name not file

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

 



On Fri, May 1, 2009 at 9:34 AM, MikeP <mpeloso@xxxxxxxxxxxxx> wrote:
> I'm not trying to get the path, just the filename and size, I know how to
> get these, but that would include the file using $_Files, but I dont want to
> upload anything just use the filename and size.(without the path) to insert
> into a DB.

Those are attributes of the file for which you dont have access
remotely, and the only way to access this information without an
upload will be using the same hacks as those spywarez use.  A
technology like flash has read/write access to the remote user's disk
(to a certain extent), you could use flash to get that information and
make it send it to you, same thing could be done with ActiveX, etc...
PHP, JS and HTTP protocol cannot acheive what you want.  (PHP is
server-side, HTTP is for communication only, JS is client-side but
locked down very much).

However, at a very low level, it might be possible to achieve this in
PHP, you could do the upload as if you wanted the whole file.  But the
first packet received will contain the HTTP Header, and in the header,
you should have all the info you need (filename and size of data).
So, low-level speaking, as soon as you receive the first packet and
have the info, you just need to close the connection (remote end might
display an error msg saying the upload failed, etc).  PHP supports
sockets connections, so you could make a basic 'server' that listens
on another port to perform this.  But i see no way to acheive your
goal without complications.

Good luck!

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