Re: How do I specify a local file for fopen()?

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

 



Server can't access files on clients computers as they wish or it would be madness. Nothing would be secure. However you can get to the file if you make it public in some way and with some restrictions. Therea are several methods: 1. (wich i think is best) install a ftp server and "share" the file through the server. use the php's ftp function to access the file 2. install a webserver like apache and place the file you want in the web-root folder (the public on). use fopen or whatever you want to open the file.

you must keep in mind that in order to do this you have to have a public ip adress (you can't do it if youre behind nat)


Jon Westcot wrote:
Hi all:

    I've been beating my head against a brick wall trying to figure this out and I'm still no closer than I was two weeks ago.

    How do I specify a local file on my computer to use with fopen() on the server?

    I've checked and the allow_url_fopen setting is set to On.  I use the html <input type="file"> to let me browse to the file.  This, however, forces me to also POST the entire file to the server, which I DO NOT WANT it to do.  I just wanted to be able to use the <Browse> button to get to the file name.  But, even when I do this, the file name returned in the $_FILES array doesn't give me a file name that fopen() will actually open.

    Do I somehow have to get the server to recognize my computer as an http-based address?  If so, how do I do this?  The computer that has the file to be opened is a Windows-based computer (running WinXP or Vista), and it obviously has an Internet connection.  Do I need to retrieve, from the server, my computer's IP address and use that, in whole or in part, to reference the file to be opened?  If so, how?

    While I'm asking questions, does anyone know how to keep the file referenced in the <input type="file"> setup from actually being sent?  All I think I really need is the NAME of the file, not its actual contents, since I'm hoping to use fopen() to open the file and then to use fgetcsv() to retrieve the contents.

    ANY help you all can send my way will be greatly appreciated!

    Thanks in advance,

        Jon


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