karstenv2002 Posted February 2, 2007 Share Posted February 2, 2007 Hi List, Here is a php (windows server with IIS) newbie question. I am trying to do the following: I have php running on my windows (IIS) server and wrote some scripts to have a user “upload” a file (basically I only want to read a text containing addresses), and pass those addresses to my php scripts on the server that processes them (geocodes the address). All works fine when the address text file is located on the server itself. It doesn’t work from a client machine though. When I open the URL and send the file name to php via html form like “geo2.php?&filename=" + sendfilename”) and try to read that file. I am using fopen like this: … $fd = fopen ($filename, "r"); $contents = fread ($fd,filesize ($filename)); fclose ($fd); … PHP gets me this error using fopen: Input file: file://F://web/read2/adress_only.csv Warning: fopen(file://F://web/read2/adress_only.csv) [function.fopen]: failed to open stream: Permission denied in D:\web\sites\mapserver\geotool\geo2.php on line 13 I guess it’s a permission issue and searched the web …- some people where saying that IIS can only access remote files on a windows box if they have a user account on the client machine (where the file text is located) – so that is not an option for me since its not and intranet application. How would I go about reading the file on the client machine and getting that information to my php scripts on the server? Use JavaScript to read the file and send via php post or get? Upload the file to the server and then read it with php? Which way should I go? Thanks Karsten Quote Link to comment https://forums.phpfreaks.com/topic/36851-reading-remote-file-on-client-machine/ Share on other sites More sharing options...
trq Posted February 4, 2007 Share Posted February 4, 2007 Your only option is to upload the file to the server. PHP cannot read files on the client, and neither can Javascript. Quote Link to comment https://forums.phpfreaks.com/topic/36851-reading-remote-file-on-client-machine/#findComment-176904 Share on other sites More sharing options...
thunderspy1200 Posted August 21, 2007 Share Posted August 21, 2007 I, too, have this same problem... Would it be possible to read the a file on a remote machine from a php script on IIS6, while both machines reside on the same network (intranet)? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/36851-reading-remote-file-on-client-machine/#findComment-330040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.